Unit 1 Part 2
Unit 1 Part 2
CLASSICAL ENCRYPTION
TECHNIQUES
What is Encryption?
ENCRYPTION DECRYPTION
Techniques in Syllabus -
Substitution and Transposition
1. Substitution
a. Caesar Cipher
b. Monoalphabetic ciphers
i. Playfair cipher
ii. Hill Cipher
c. Polyalphabetic Ciphers
i. Vigenere Ciphere
ii. Vernam Cipher
d. One time pad
2. Transposition - Rail fence technique
1. Caesar Cipher
For Shift value k =3
How to find mod values?
Example 2
ENCRYPTION
C S E I S G O O D
Example 2
DECRYPTION
F V H L V J R R G
Key Points
The earliest known, and the simplest, use of a substitution cipher was by Julius
Caesar. The Caesar cipher involves replacing each letter of the alphabet with the
letter standing k places further down the alphabet
If it is known that a given ciphertext is a Caesar cipher, then a brute-force
cryptanalysis is easily performed: simply try all the 25 possible keys.
Points to use a bruteforce cryptanalysis:
1. The encryption and decryption algorithms are known.
2. There are only 25 keys to try.
3. The language of the plaintext is known and easily recognizable
Not plain language
● If the language of the plaintext is unknown, then plaintext output may not be
recognizable. Furthermore, the input may be abbreviated or compressed in
some fashion, again making recognition difficult.
● For example, Figure 3.4 shows a portion of a text file compressed using an
algorithm called ZIP. If this file is then encrypted with a simple substitution
cipher (expanded to include more than just 26 alphabetic characters), then
the plaintext may not be recognized when it is uncovered in the brute-force
cryptanalysis.
Monoalphabetic Ciphers _ Why needed?
With only 25 possible keys, the Caesar cipher is far from secure.
A dramatic increase in the key space can be achieved by allowing an arbitrary
substitution. Before proceeding, we define the term permutation.
A permutation of a finite set of elements S is an ordered sequence of all the
elements of S, with each element appearing exactly once.
A B C
How secure are monoalphabetic ciphers?
If, instead, the “cipher” line can be any permutation of the 26 alphabetic
characters, then there are 26!. ( PREVENTS BRUTE FORCE ATTACK)
If the cryptanalyst knows the nature of the plaintext (e.g., noncompressed English
text), then the analyst can exploit the regularities of the language.
How it is broken?
Inference from previous images:
● Comparing this breakdown with Figure 3.5, it seems likely that cipher letters P
and Z are the equivalents of plain letters e and t, but it is not certain which is
which. The letters S, U, O, M, and H are all of relatively high frequency and
probably correspond to plain letters from the set {a, h, i, n, o, r, s}.
● The letters with the lowest frequencies (namely, A, B, G, Y, I, J) are likely
included in the set {b, j, k, q, v, x, z}.
● There are a number of ways to proceed at this point. We could make some
tentative assignments and start to fill in the plaintext to see if it looks like a
reasonable “skeleton” of a message. A more systematic approach is to look
for other regularities
What other ways to infer?
Playfair Cipher
How to encrypt?
How to decrypt?
Example - Encryption instrumentsz
Example - Decryption gatlmzclrqtx
Key Points
Strength
Drawback:- Despite this level of confidence in its security, the Playfair cipher is
relatively easy to break, because it still leaves much of the structure of the
plaintext language intact. A few hundred letters of ciphertext are generally
sufficient.
BASICS OF MATRIX
Arrangement of numbers into rows and columns
Identity Matrix
Determinant of a Matrix
Inverse of a matrix
Transpose of Matrix
Inverse Eg 2
Matrix Multiplication
Eg 1
Eg 2
HILL CIPHER
(Involves Matrices and Determinants)
Encryption
C = PK MOD 26
Example of Encryption C: = PK MOD 26 Step 1 : find PK
Plain Text - PAY
Example of Encryption C: = PK MOD 26 Step 2 : find C
Plain Text - PAY
THANK YOU
Decryption P = CK-1 MOD 26
Decryption Example P = CK-1 MOD 26 Step 1 : find |K|
Cipher text RRL
Decryption Example P = CK-1 MOD 26 Step 2 : find adj K
Cipher text RRL
Decryption Example P = CK-1 MOD 26 Step 3 : find inv K
Cipher text RRL
Decryption Example P = CK-1 MOD 26 Step 4 :
Cipher text RRL find K-1 mod 26
Decryption Example P = CK-1 MOD 26 Step 5 : find P
Cipher text RRL
THANK YOU