Saturday, October 2, 2021

Playfair Cipher in network security | Playfair cipher example | playfair cipher encryption example | playfair cipher in cryptography

     Introduction

There are basically two types of symmetric cipher: Substitution Cipher, Transposition Cipher.

Substitution Cipher: A substitution is a technique in which each letter or bit of the plaintext is substituted or replaced by some other letter, number or symbol to produce cipher text. For Example, ABC  XYZ.

Types of Substitution Cipher: Caesar Cipher, Monoalphabetic Cipher, Vigenère Cipher, Playfair Cipher, One time pad cipher (Vernam cipher), Hill Cipher.

Transposition Cipher: In transposition technique, there is no replacement of alphabets or numbers occurs instead their positions are changed or reordering of position of plain text is done to produce cipher text. For Example, ABCDE    BADEC.

Types of Transposition Cipher: Rail Fence Cipher, Columnar Transposition Cipher.

 

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)

For Example, MY NAME IS MAHI

Plain text: MY NA ME IS MA HI

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.

For Example, GREEN

Plain text: GR EX EN

For Example, NETWORK

Plain text: NE TW OR KX

 

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

To learn more about Playfair Cipher, Click here

  
    Watch more videos click here.

4 comments:

  1. Thank you so much sir,for the clean and detailed explanation of playfair cipher.Your explanation is simply superb.

    ReplyDelete
    Replies
    1. You are welcome... Please follow my blog and susbcribe my channel....

      Delete
  2. can you share the ppt that you have done
    dhananjayraskar2000@gmail.com on this mail

    ReplyDelete
    Replies
    1. Ohh...dear... Ppts are not available due to laptop issues.... So I have posted everything on my blog...

      Delete