Prof. Neeraj Bhargava
Mrs. Shubha Chaturvedi
Department of Computer Science, School of Engineering & System
Sciences
MDS University Ajmer, Rajasthan
 It is also known as Multiple groups substitution.
 It involves replacing a one group of character in the
plaintext message with another groups of character in
cipher text.
 In a Polygraphic Substitution cipher, plaintext letters are
substituted in larger groups, instead of substituting
letters individually.
 Here the plaintext is divided into groups of adjacent
letters of the same fixed length and than each such
group is transformed into a different group of same
length letters in cipher text.
 n playfair cipher unlike traditional cipher we encrypt a
pair of alphabets(digraphs) instead of a single alphabet.
1. Playfair cipher
2. Hill cipher
 Hill cipher is a polygraphic substitution cipher based on
linear algebra.
 Each letter is represented by a number modulo 26. Often
the simple scheme A = 0, B = 1, …, Z = 25 is used, but
this is not an essential feature of the cipher.
 To encrypt a message, each block of n letters (considered
as an n-component vector) is multiplied by an invertible n
× n matrix, against modulus 26.
 To decrypt the message, each block is multiplied by the
inverse of the matrix used for encryption.
 The matrix used for encryption is the cipher key, and it
should be chosen randomly from the set of invertible n ×
n matrices (modulo 26).
 The hill cipher formula can be expressed in
terms of columns ,vectors and matrics.
Encryption =c=(k*p) mod 26
Decryption=p=(k*c)mod 26
 We have to encrypt the message ‘ACT’ (n=3).The key is ‘GYBNQKURP’ which
can be written as the nxn matrix:
 To decrypt the message, we turn the ciphertext back into a vector, then
simply multiply by the inverse matrix of the key matrix (IFKVIVVMI in
letters).The inverse of the matrix used in the previous example is:
 Given Plaintext is = “DOG”
 Step1-Put DOG in a matrix from according to
numbers. D= 3
O= 14
G= 6
 Choose a random key according to the size of
plain text. Random key is 3*3
 3 6 24 1
14 13 16 10
6 20 17 5
 Step3-multiple the 2 matrices
3 6 24 1
14 13 16 10
6 20 17 5
 3*6 18 + 14*24 336 + 6*1 6 = 360/26 = 22
3*13 39 + 14*16 224 + 6*10 60 = 323/26 = 11
3*20 60 + 14*17 238 + 6*15 90 = 388/26 = 24
Now we get a cipher text which is =
22
11
24
 Step4- we will convert this cipher text into
the plain text:
22 = W
11 = L
24 = Y

Polygraphic Substitution Cipher - Part 2

  • 1.
    Prof. Neeraj Bhargava Mrs.Shubha Chaturvedi Department of Computer Science, School of Engineering & System Sciences MDS University Ajmer, Rajasthan
  • 2.
     It isalso known as Multiple groups substitution.  It involves replacing a one group of character in the plaintext message with another groups of character in cipher text.  In a Polygraphic Substitution cipher, plaintext letters are substituted in larger groups, instead of substituting letters individually.  Here the plaintext is divided into groups of adjacent letters of the same fixed length and than each such group is transformed into a different group of same length letters in cipher text.  n playfair cipher unlike traditional cipher we encrypt a pair of alphabets(digraphs) instead of a single alphabet.
  • 3.
  • 4.
     Hill cipheris a polygraphic substitution cipher based on linear algebra.  Each letter is represented by a number modulo 26. Often the simple scheme A = 0, B = 1, …, Z = 25 is used, but this is not an essential feature of the cipher.  To encrypt a message, each block of n letters (considered as an n-component vector) is multiplied by an invertible n × n matrix, against modulus 26.  To decrypt the message, each block is multiplied by the inverse of the matrix used for encryption.  The matrix used for encryption is the cipher key, and it should be chosen randomly from the set of invertible n × n matrices (modulo 26).
  • 5.
     The hillcipher formula can be expressed in terms of columns ,vectors and matrics. Encryption =c=(k*p) mod 26 Decryption=p=(k*c)mod 26
  • 7.
     We haveto encrypt the message ‘ACT’ (n=3).The key is ‘GYBNQKURP’ which can be written as the nxn matrix:
  • 8.
     To decryptthe message, we turn the ciphertext back into a vector, then simply multiply by the inverse matrix of the key matrix (IFKVIVVMI in letters).The inverse of the matrix used in the previous example is:
  • 9.
     Given Plaintextis = “DOG”  Step1-Put DOG in a matrix from according to numbers. D= 3 O= 14 G= 6  Choose a random key according to the size of plain text. Random key is 3*3  3 6 24 1 14 13 16 10 6 20 17 5
  • 10.
     Step3-multiple the2 matrices 3 6 24 1 14 13 16 10 6 20 17 5  3*6 18 + 14*24 336 + 6*1 6 = 360/26 = 22 3*13 39 + 14*16 224 + 6*10 60 = 323/26 = 11 3*20 60 + 14*17 238 + 6*15 90 = 388/26 = 24
  • 11.
    Now we geta cipher text which is = 22 11 24  Step4- we will convert this cipher text into the plain text: 22 = W 11 = L 24 = Y