0% found this document useful (0 votes)
70 views48 pages

Substitution Techniques

The document discusses classical encryption techniques, focusing on substitution ciphers where plaintext letters are replaced by other letters, numbers, or symbols. It details various types of substitution techniques, including the Caesar Cipher, Playfair Cipher, Hill Cipher, and One-Time Pad, explaining their mechanisms and security features. Additionally, it highlights the cryptanalysis of these ciphers and the importance of key management in ensuring encryption security.

Uploaded by

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

Substitution Techniques

The document discusses classical encryption techniques, focusing on substitution ciphers where plaintext letters are replaced by other letters, numbers, or symbols. It details various types of substitution techniques, including the Caesar Cipher, Playfair Cipher, Hill Cipher, and One-Time Pad, explaining their mechanisms and security features. Additionally, it highlights the cryptanalysis of these ciphers and the importance of key management in ensuring encryption security.

Uploaded by

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

Classical Encryption

Techniques : Substitution
Techniques
Classical Substitution Ciphers
• where letters of plaintext are replaced by
other letters or by numbers or symbols
• or if plaintext is viewed as a sequence of bits,
then substitution involves replacing plaintext
bit patterns with ciphertext bit patterns
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Caesar Cipher
• earliest known substitution cipher
• by Julius Caesar
• first attested use in military affairs
• replaces each letter by 3rd letter on
• example:

plain: meet me after the class

cipher: PHHW PH DIWHU WKH FODVV



Caesar Cipher
• can define transformation as:
• plain: a b c d e f g h i j k l m n o p q r s t u v w x y z
• cipher: D E F G H I J K L M N O P Q R S T U V W X Y Z A B C
• mathematically give each letter a number

• then have Caesar cipher as:


c = E(p) = E(3,p)=(p + 3) mod (26)
p = D(c) = D(3,c)=(c – 3) mod (26)
Types Of Substitution Techniques
• Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Mono aplhabetic Cipher
• The original plain text alphabets may be any places down the
line

• then have Caesar cipher as:


c = E(k,p)=(p + k) mod (26)
p = D(k,c)=(c – k) mod (26)

• Where k= 1,2,…….25
Cryptanalysis of Modified Caesar
Cipher
• only have 26 possible ciphers
– A maps to A,B,..Z
• could simply try each in turn
• a brute force search
• given ciphertext, just try all shifts of letters
• do need to recognize when have plaintext
• eg. break ciphertext "GCUA VQ DTGCM"
Example
cipher: GCUA VQ DTGCM

cipher: KWUM PMZM


Example
cipher: GCUA VQ DTGCM

Plain: EASY TO BREAK

cipher: KWUM PMZM


Example
cipher: GCUA VQ DTGCM

Plain: EASY TO BREAK

cipher: KWUM PMZM

Plain: COME HERE


Types Of Substitution Techniques
• Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Playfair Cipher
• not even the large number of keys in a
monoalphabetic cipher provides security
• one approach to improving security was to
encrypt multiple letters
• the Playfair Cipher is an example
• invented by Charles Wheatstone in 1854, but
named after his friend Baron Playfair
Playfair Cipher steps

Playfair Cipher

Step 1: Creation and Population of Matrix

Step 2: Encryption Process


Step 1: Creation and Population of Matrix

• a 5X5 matrix of letters based on a keyword


is used
• The way this is entered into the 5X5 matrix
is based on the following rules:
Rules of Matrix Creation and
Population
1. Enter the keyword in the matrix row-wise; left-to-right;
top-to-bottom.
2. Drop Duplicate letters.
3. Fill the remaining spaces in the matrix with the rest of
the English alphabets (A-Z), that were not a part of our
keyword, While doing so, combine I and J in the same
cell of the table.
In other words, if I or J is a part of the keyword,
disregard both I and J while filling the remaining slots
5X5 matrix

• Keyword – PLAYFAIR EXAMPLE

P L A Y F

I R E X M

B C D G H

K N O Q S

T U V W Z
5X5 matrix

• Keyword – PLAYFAIR EXAMPLE

P L A Y F

I R E X M

B C D G H

K N O Q S

T U V W Z
Step 2: Encryption Process

1. The message is to be broken down into groups of two


alphabets. The encryption process works on this broken-
down message
2. if a pair has a repeated letter, insert filler like 'X’
3. if both letters fall in the same row, replace each with letter to
right (wrapping back to start from end)
4. if both letters fall in the same column, replace each with the
letter below it (again wrapping to top from bottom)
5. if the letters 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
Example:

• Encrypt the sentence:


• KEEP SILENCE
• KE EP SI LE NC EX
P L A Y F P L A Y F
I R E X M I R E X M
B C D G H B C D G H
K N O Q S
K N O Q S
T U V W Z
T U V W Z
Example:
P L A Y F P L A Y F
I R E X M I R E X M
B C D G H B C D G H
K N O Q S K N O Q S
T U V W Z T U V W Z
P L A Y F P L A Y F
I R E X M I R E X M
B C D G H B C D G H
K N O Q S K N O Q S
T U V W Z T U V W Z
Example:
• Plain : KEEP SILENCE
• KE EP SI LE NC EX

• OI IA KM AR UN XM
Example
• GOOD MORNING

• Encrypt the above text using Play Fair Cipher


Quizzzzzzzzzzzzz

• Construct a Playfair matrix with the key


largest
• Construct a Playfair matrix with the key
occurrence
• Encrypt the text “I M A HACKER”
• Using the key Largest
• Decrypt the text:
“vxlemouvgarkbyayfppeem”
Security of Playfair Cipher
• security much improved over monoalphabetic
• since have 26 x 26 = 676 digrams
• would need a 676 entry frequency table to analyse
(verses 26 for a monoalphabetic)
• and correspondingly more ciphertext
• was widely used for many years
– eg. by US & British military in WW1
• it can be broken, given a few hundred letters
• since still has much of plaintext structure
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Hill Cipher
• It was developed by the mathematician Lester Hill in 1929

• The encryption algorithm takes m successive plaintext letters


and substitutes for them m ciphertext letters

• The substitution is determined by m linear equations in


which each character is assigned a numerical value:
Hill Cipher
• For m=3, the system can be described as
follows:
C1=(k11p1+k12p2+k13p3) mod 26
C2=(k21p1+k22p2+k23p3) mod 26
C3=(k31p1+k32p2+k33p3) mod 26
Hill Cipher
• This can be expressed in terms of column vectors
and matrices:
C=KP mod 26,
• where C and P are column vectors of length 3,
representing the ciphertext and plaintext
respectively, and K is 3x3 matrix, representing the
encryption key.

Hill Cipher- Example
• Given, Plaintext = paymoremoney

• encryption key =

• Consider m=3
• Plaintext = paymoremoney

1 0 24
5
The first three letters of the plaintext are represented by the vector
• Then, C = KP mod 26
=
• Cipher Text :
Decryption
• Decryption requires using the inverse of the
matrix K
• KK1 = K1K = I,
P=

= 431
=
= Pay
494

570
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Polyalphabetic Ciphers
• polyalphabetic substitution ciphers
• improve security using multiple cipher alphabets
• make cryptanalysis harder with more alphabets
to guess and flatter frequency distribution
• use a key to select which alphabet is used for
each letter of the message
• use each alphabet in turn
• repeat from start after end of key is reached
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
Types Of Substitution Techniques
• Caesar Cipher
• Modified Caesar Cipher
• Mono-alphabetic Cipher
• PlayFair Cipher
• Hill Cipher
• Poly-alphabetic Cipher
• One-Time Pad
One-Time Pad
• if a truly random key as long as the message is used,
the cipher will be secure
• called a One-Time pad
• is unbreakable since ciphertext bears no statistical
relationship to the plaintext
• since for any plaintext & any ciphertext there exists
a key mapping one to other
• can only use the key once though
• problems in generation & safe distribution of key

You might also like