0% found this document useful (0 votes)
21 views20 pages

Lecture 4

Uploaded by

sobia.shafique
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views20 pages

Lecture 4

Uploaded by

sobia.shafique
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Data Security and

Encryption
Lecture # 4
By: Engr. Sundas Hanif
[email protected]
The increased use of computer and
communications systems by industry has
increased the risk of theft of proprietary
information. Although these threats may
require a variety of countermeasures,
encryption is a primary method of
protecting valuable electronic information.
Transposition Cipher -- Class
Practice
• Encrypt the message using Rail-fence cipher with
key = 3

IHAVEABIGSECRET
Transposition Cipher -- Class
Practice
• Decrypt the message
AES EAO OIT VUI NNN NEE RLC FTE LNV
LER LS
• if it was encrypted using tabular
(Columnar) transposition cipher with rows
of length 4 characters
Classical Encryption Techniques
• Transposition
• Substitution
Substitution Technique
• The letters of plaintext are replaced by other
letters or by numbers or symbols to generate the
ciphertext
• Monoalphabetic substitution cipher
• Polyalphabetic substitution cipher
The Ceasar Substitution Cipher
• The Ceasar cipher is named after Julius Ceasar, said to be
the first to use it
• In the Ceasar cipher, each character is substituted by
another
• This technique is called monoalphabetic cipher
• It involves replacing each letter of the alphabet with the
letter standing three places further down the alphabet
• plain: meet me after the toga
party
• cipher: PHHW PH DIWHU WKH WRJD SDUWB
The Ceasar Cipher Cont.
• the alphabet is wrapped around, so that the letter
following Z is A
The Ceasar Cipher Cont.
• A shift can be of any amount!
• Then the general Ceasar algorithm can be
expressed as follows;
C = E(k, p) = (p + k) mod 26
• The decryption algorithm is simply;
p = D(k, C) = (C - k) mod 26
Class Practice
• Encrypt the following;
MISSION IMPOSSIBLE

• Decrypt the following;


KOHQV CIH TCF PFIHIG
Polyalphabetic Substitution
Cipher
• Because monoalphabetic ciphers are so
notoriously insecure, cryptographers invented
polyalphabetic substitution ciphers
• Polyalphabetic cipher uses a number of
substitutions at different positions in the
message
• A unit from the plaintext is mapped to one of
several possibilities in the ciphertext
The Play-fair Substitution
Cipher
• The playfair cipher or playfair square is a manual
symmetric encryption technique and was the
first literal digraph substitution cipher
• The scheme was invented in 1854 by Charles
Wheatstones but bears the name after Lord
Playfair who promoted the use of the cipher
The Play-fair Substitution
Cipher
• If m1 and m2 are in the same row, then c1 and c2 are
the two characters right to m1 and m2 respectively
• If m1 and m2 are in the same column, then c1 and c2 are
below the m1 and m2
• If m1 and m2 are in different rows and columns, then c1
and c2 are the corners of their rectangle (pick same rows
and opposite column)
• If m1 = m2, then a null character (e.g x) is inserted in
the plaintext between them to eliminate the double
• If the plaintext has odd number of characters then a null
character is appended to the plaintext
The Play-fair Cipher Key Matrix
• The key matrix for Play-fair cipher is computed
as shown in the next slide
• Example: let’s assume the key word is
MONARCHY
• The size of the matrix is [5 x 5]
• The key word is entered into the grid first
• Then the remaining of the alphabets are
entered into the grid
Play-fair Cipher Encryption
• Encryption is done using the rules discussed
• Example:
SECRET MESSAGE
SE CR ET ME SS AG E
SE CR ET ME SX SA GE

• Key: KEYWORD
Play-fair Cipher Decryption
• For decryption, same rules of encryption are
applied but in opposite direction
Example:
• Assume this encrypted message is received
SH HA HR FB BL VP KD

• Key: KEYWORD
Class
Practice
Class Practice
• Encrypt the following message by using the
matrix given on the previous slide;

Must see you over Cadogan


West. Coming at once.
Class Practice
• Construct a Playfair matrix with the key
LARGEST

• Construct a Playfair matrix with the key


OCCURRENCE. Make a reasonable
assumption about how to treat redundant
letters in the key.

You might also like