[go: up one dir, main page]

0% found this document useful (0 votes)
5 views22 pages

Lecture 3

The document provides an overview of various cipher techniques, including the Playfair Cipher, Columnar Transposition Cipher, and Rail Fence Cipher. It outlines the rules for encryption and decryption processes for each cipher, emphasizing the use of keywords and matrix arrangements. Additionally, it highlights the differences between substitution and transposition ciphers.

Uploaded by

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

Lecture 3

The document provides an overview of various cipher techniques, including the Playfair Cipher, Columnar Transposition Cipher, and Rail Fence Cipher. It outlines the rules for encryption and decryption processes for each cipher, emphasizing the use of keywords and matrix arrangements. Additionally, it highlights the differences between substitution and transposition ciphers.

Uploaded by

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

Network Security Course Nahida Nigar

Symmetric cipher

Lecture 3
Playfair Cipher
• Playfair cipher is type of substitution cipher.
• It is also called polyalphabetic substitution cipher.
• In this cipher techniques, more than one character is used during
encryption/decryption. So, this cipher technique is called multiple
substitution cipher technique.
• Input of this technique are keyword and plain text.
• Keyword is one type of string.
Rules of encryption is as follows:
• Step-1: Construct 5x5 matrix of given keyword(key). The letter “I” and
“J” will be consider as one letter. So, if “I” is already placed then no
need to place “J” in rest of matrix. (Or write I/J).
• For Example, Keyword = MONARCHY
• Step-2: If any characters are to be repeated in given keyword, used it
only once during matrix filling.
• For Example, Keyword = PLAYFAIR
• Step-3: Plain text is broken down into groups of two alphabets. There
are two possibilities.
• Possibility-1: Plain text message that we want to encrypt broken
down into groups of two alphabets. (Make pair of two alphabets of
given plain text)
• Possibility-2: If both alphabets are the same (or only one is left) in
plain text, add an X after the first alphabet. Encrypt the new pair and
continue.
• Step-4: When pair of plain text will be encrypt using matrix, there are
3 possibilities.
• Possibility-1: If the alphabets are not in the same row or column,
replace them with the alphabets in the same row respectively, but at
the other pair of corners of the rectangle defined by the original pair.
• Possibility-2: If both the alphabets in the pair appear in the same row
of matrix, replace them with alphabets to their immediate right
respectively.
• If the original pair is on the right side of the row, then wrapping
around to the left side of the row happens.
• Possibility-3: If both alphabets in the pair appear in the same column
of matrix, replace them with alphabets immediate below from
respectively.
• If the original pair is on the bottom side of the column, then wrapping
around to the top side of the column happens.
Exercise
• Question: Find out cipher text of below plain text using “Playfair
Cipher”.
• Plaintext: TREE IS GREEN
• Keyword: ENVIRONMENT
Transposition Cipher
Columnar Transposition Cipher
• The Columnar Transposition Cipher is a form of transposition cipher in
which plain text represent in matrix form.
• Columnar Transposition involves writing the plaintext out in rows, and
then reading the ciphertext off in columns one by one.
Rules of Encryption Process
• Example: Plain Text: TREE IS GREEN, Key = HACK (Key length = 4)
• Step-1: Width of the rows and the permutation of the columns are
usually defined by a keyword.
• Step-2: Keyword HACK is of length 4 (so the rows are of length 4), and
the permutation is defined by the alphabetical order of the letters in
the keyword. In this case, the order would be “3 1 2 4”.
• Step-3: The message is written out in rows of a fixed length.
• Step-4: Any spare spaces are filled with nulls or left blank or placed by
a character (Example: _).
• Step-5: Finally, the message is read off in columns, in the order
specified by the keyword.
Rules of Decryption Process
• As per above example:
• Cipher Text: R I R _ E S E _ T _ G N E _ E _
• Key = HACK (Key length = 4)
• Step-1: To decipher it, the recipient has to work out the column
lengths by dividing the message length by the key length.
• Step-2: Then, write the cipher text in columns again, then re-order
the columns by reforming the keyword. Read matrix row wise to get
plain text.
Rail Fence Cipher/Zigzag Cipher
• The rail fence cipher (sometimes called zigzag cipher) is a
transposition cipher that jumbles up the order of the letters of a
message using a basic algorithm.
• It is one of the easy techniques of transposition cipher in which
position of letters are changed.
• The rail fence cipher works by writing your message on alternate lines
across the page, and then reading off each line in turn.
• Note that all white spaces have been removed from the plain text.
Example – 1 (Depth/Key = 2)
• Plaint Text: SECRET MESSAGE (Depth/Key = 2)
• To encode this message, we will first write over two lines (the “rails of the
fence”) as follows:

• The ciphertext is then read off by writing the top row first, followed by the
bottom row
• Cipher Text: S C E M S A E E R T E S G
Example – 2 (Depth/Key = 3)
• Plaint Text: SECRET MESSAGE (Depth/Key = 3)
• To encode this message, we will first write over two lines (the “rails of the
fence”) as follows:

• The ciphertext is then read off by writing the top row first, followed by the
bottom row.
• Cipher Text: S E S E E R T E S G C M A
Difference between Substitution Cipher and
Transposition Cipher

You might also like