Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Comp. & Net. security : Lecture 4 Lecturer: Dr.

Mohammed Hasan

 PlayFair Cipher:
Playfair cipher (Polygraphic Ciphers) is a diagram substitution cipher, the key is given by a
5*5 matrix of 25 letters . To generate the table, one would first fill in the spaces of the table
with the letters of the keyword (dropping any duplicate letters), then fill the remaining spaces
with the rest of the letters of the alphabet (to reduce the alphabet to fit you can either omit
"Q" or replace "J" with "I").

Each pair of plaintext letters are encrypted according to the following rules:

1. If m1 and m2 are in the same row, then c1 and c2 are to the right of m1 and m2,
respectively. The first column is considered to the right of the last column.
2. If m1 and m2 are in the same column, then c1 and c2 are below m1 and m2
respectively. The first row is considered to be below the last row.
3. If m1 and m2 are in different rows and columns, then c1 and c2 are the other two
corners of the rectangle.
4. If both letters are the same, add an X between them. Encrypt the new pair, re-pair
the remining letters and continue.
5. If the plaintext has an odd number of characters, a null letter is appended to the end
of the plaintext.
Comp. & Net. security : Lecture 4 Lecturer: Dr. Mohammed Hasan

Example1

Let us encrypt the plaintext “hello” using the key in Figure above.

Example2

H A R P S
I C O D B
E F G K L
M N Q T U
V W X Y Z
Key

M = RE ND IS SA NC EX

C = HG TC BH HR WF GV
Comp. & Net. security : Lecture 4 Lecturer: Dr. Mohammed Hasan

 Vigenere Cipher

The Vigenere cipher is a method of encrypting alphabetic text by using a series of interwoven
Caesar ciphers based on the letters of a keyword. It is a form of polyalphabetic substitution.

Example

We can encrypt the message “She is listening” using the 6-character keyword “PASCAL”. Let us
see how we can encrypt the message “She is listening” using the 6-character keyword
“PASCAL”. The initial key stream is (15, 0, 18, 2, 0, 11). The key stream is the repetition of this
initial key stream (as many times as needed).

You might also like