SlideShare una empresa de Scribd logo
1 de 174
Descargar para leer sin conexión
Information
Security
UNIT 1: SYMMETRIC CIPHER MODEL, CRYPTOGRAPHY, CRYPTANALYSIS
AND ATTACKS; SUBSTITUTION AND TRANSPOSITION TECHNIQUES
REFERENCE BOOK- CRYPTOGRAPHY AND NETWORK SECURITY, PRINCIPLES
AND PRACTICE SIXTH EDITION, WILLIAM STALLINGS, PEARSON
CHAPTER -2 CLASSICAL ENCRYPTION TECHNIQUES
Road Map
 Symmetric Cipher Model: Cryptography,
Cryptanalysis and Attacks
 Substitution techniques
 Transposition techniques
Basic Terminology
 Plaintext - the original message
 Ciphertext – encrypted or the coded message
 enciphering (encryption) - The process of converting from
plaintext to ciphertext
 Encryption algorithm: performs encryption
 Two inputs: a plaintext and a secret key
 deciphering (decryption) – process of recovering ciphertext
from plaintext
 Decryption algorithm: performs decryption
 Two inputs: ciphertext and secret key
 Secret key: key used for encryption and decryption
 If same key is used then known as symmetric cryptology
 If Different key is used then known as asymmetric
cryptology
Basic Terminology
 Cipher – a particular algorithm (cryptographic system)
 cryptography - study of algorithms used in encryption
 cryptanalysis (codebreaking) - the study of techniques used in
decryption without knowing plaintext (i.e. he study of the
cryptographic algorithm and the breaking of those secret codes)
 cryptology - the field of both cryptography and cryptanalysis
 The person practicing Cryptanalysis is called a Cryptanalyst.
 It helps us to better understand the cryptosystems and also
helps us improve the system by finding any weak point and thus
work on the algorithm to create a more secure secret code.
 For example, a Cryptanalyst might try to decipher a ciphertext
to derive the plaintext. It can help us to deduce the plaintext or
the encryption key.
Symmetric Cypher model (Conventional Encryption)
Symmetric Cypher model (Conventional Encryption)
Symmetric Cypher model (Conventional Encryption)
X=D(K,Y)
Requirement and Assumption
 Requirement
 a strong encryption algorithm-given algorithm and cipher
text , attacker can not obtained key or plain text
 a shared secret key: Sender and receiver must have
obtained copies of the secret key in a secure fashion and
must keep the key secure.
Y = EK(X)
X = DK(Y)
 Assumption
 encryption algorithm is known
 a secure channel to distribute key
Symmetric encryption
Mathematically:
Y = EK(X) or Y = E(K, X)
X = DK(Y) or X = D(K, Y)
X = plaintext
Y = ciphertext
K = secret key
E = encryption algorithm
D = decryption algorithm
Both E and D are known to public
Model of Symmetric Cryptosystem
Model of Symmetric Cryptosystem
X
X
Cryptography
Cryptographic systems are characterized along three independent
dimensions:
1. The type of operations used for transforming plaintext to
ciphertext.
 All encryption algorithms are based on two general principle:
 Substitution - in which each element in the plaintext is
mapped into another element
 transposition, in which elements in the plaintext are
rearranged.
 The fundamental requirement is that no information be lost.
(i.e., that all operations are reversible).
 Most systems, referred to as product systems, involve multiple
stages of substitutions and transpositions
Cryptography
Cryptographic systems are characterized along three independent
dimensions:
2. The number of keys used.
 If both sender and receiver use the same key, the system is
referred to as symmetric, single-key, secret-key, or conventional
Encryption
 If the sender and receiver use different keys, the system is
referred to as asymmetric, two-key, or public-key encryption.
Cryptography
Cryptographic systems are characterized along three independent
dimensions:
3. The method used to process plaintext –block cipher, stream
cipher
Cryptanalysis and Brute-Force Attack
Types of Cryptanalytic Attacks
 ciphertext only
 know a) algorithm b) ciphertext
 known plaintext
 know some given plaintext/ciphertext pairs
 chosen plaintext
 select plaintext and obtain ciphertext
 chosen ciphertext
 select ciphertext and obtain plaintext
 chosen text
 select either plaintext or ciphertext to en/decrypt
to attack cipher
Types of Cryptanalytic Attacks: Ciphertext only
 In the ‘cipher-only’ attack, the attacker knows the ciphertext of
various messages which have been encrypted using the same
encryption algorithm.
 The attacker’s challenge is to figure the ‘key’ which can then be
used to decrypt all messages.
 Only relatively weak algorithms fail to withstand a ciphertext-
only attack.
Types of Cryptanalytic Attacks: Known Plaintext (KPA)
 The attacker has a collection of plaintext-ciphertext pairs and is
trying to find the key or to decrypt some other ciphertext that
has been encrypted with the same key.
 Example: linear cryptanalysis against block ciphers.
Types of Cryptanalytic Attacks: Chosen Plaintext
 In this type of attack, the attacker chooses random plaintexts and
obtains the corresponding ciphertexts and tries to find the encryption
key.
 Its very simple to implement like KPA but the success rate is quite low.
 Example: differential cryptanalysis applied against block ciphers as well
as hash functions.
 A popular public key cryptosystem, RSA is also vulnerable to chosen-
plaintext attacks.
Types of Cryptanalytic Attacks: Chosen Ciphertext
 In this type of attack, the attacker chooses random ciphertexts and
obtains the corresponding plaintexts and tries to find the encryption key.
Types of Cryptanalytic Attacks: Chosen text
Unconditionally secure algorithm
 An encryption scheme is unconditionally secure if the
ciphertext generated by the scheme does not contain enough
information to determine uniquely the corresponding plaintext,
no matter how much ciphertext is available.
 That is, no matter how much time an opponent has, it is
impossible for him or her to decrypt the ciphertext simply
because the required information is not there.
 With the exception of a scheme known as the one-time pad,
there is no encryption algorithm that is unconditionally secure.
 i.e. no matter how much computer power is available, the
cipher cannot be broken since the ciphertext provides
insufficient information to uniquely determine the
corresponding plaintext.
Computationally secure algorithm
 An encryption scheme is said to be computationally secure if
either of the foregoing two criteria are met.
1. The cost of breaking the cipher exceeds the value of the
encrypted information.
2. The time required to break the cipher exceeds the useful
lifetime of the information.
 Unfortunately, it is very difficult to estimate the amount of
effort required to cryptanalyze ciphertext successfully
 i.e. given limited computing resources (eg time needed for
calculations is greater than age of universe), the cipher cannot
be broken
Brute Force Attack
 Try every key to decipher the ciphertext.
 On average, need to try half of all possible keys
 Time needed proportional to size of key space
Key Size (bits) Number of Alternative
Keys
Time required at 1
decryption/µs
Time required at 106
decryptions/µs
32 232 = 4.3  109 231 µs = 35.8 minutes 2.15 milliseconds
56 256 = 7.2  1016 255 µs = 1142 years 10.01 hours
128 2128 = 3.4  1038 2127 µs = 5.4  1024 years 5.4  1018 years
168 2168 = 3.7  1050 2167 µs = 5.9  1036 years 5.9  1030 years
26 characters
(permutation)
26! = 4  1026 2  1026 µs = 6.4  1012 years 6.4  106 years
Road Map
 Symmetric Cipher Model: Cryptography,
Cryptanalysis and Attacks
 Substitution techniques
 Transposition techniques
Substitution techniques
 A substitution technique is one in which the letters of plaintext are
replaced by other letters or by numbers or symbols.
 If the plaintext is viewed as a sequence of bits, then substitution
involves replacing plaintext bit patterns with ciphertext bit patterns.
A substitution cipher replaces one
symbol with another.
Caesar Cipher
 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 three places further down the
alphabet.
 Note that the alphabet is wrapped around, so that the letter
following Z is A.
Caesar Cipher
Caesar ciphers are sometimes referred
to as shift ciphers or Additive cipher.
Caesar Cipher
Caesar Cipher
 A shift may be of any amount, so that the general Caesar
algorithm is
 where k takes on a value in the range 1 to 25. The decryption
algorithm is simply
Caesar Cipher: Example
Use the Caesar cipher with key = 15 to encrypt the message
“hello”.
We apply the encryption algorithm to the plaintext, character by
character:
Solution
Caesar Cipher: Example
Use the Caesar cipher with key = 15 to decrypt the message
“WTAAD”.
We apply the decryption algorithm to the plaintext character by
character:
Solution
Cryptanalysis of Caesar Cipher
 brute-force cryptanalysis is easily performed: simply try all the
25 possible keys.
 Three important characteristics of this problem enabled us to
use a brute-force cryptanalysis:
 The encryption and decryption algorithms are known.
 There are only 25 keys to try.
 The language of the plaintext is known and easily
recognizable.
Brute force attack on Caesar Cipher
Cryptanalysis of Caesar Cipher
 Three important characteristics of this problem enabled us to
use a brute-force cryptanalysis:
 The encryption and decryption algorithms are known.
 There are only 25 keys to try.
 The language of the plaintext is known and easily
recognizable.
 The third characteristic is also significant. 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.
Monoalphabetic Cipher (simple substitution)
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.
For example, if S = {a, b, c}, there are six permutations of S:
abc, acb, bac, bca, cab, cba
In general, there are n! permutations of a set of n elements,
because the first element can be chosen in one of n ways, the
second in n - 1 ways, the third in n – 2 ways, and so on
Monoalphabetic Cipher (simple substitution)
 Each plaintext letter maps to a different random ciphertext
letter .
 Hence key is 26 letters long
Plain: abcdefghijklmnopqrstuvwxyz
Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN
 “Cipher” line can be any permutation of the 26 alphabetic char
Plaintext: ifwewishtoreplaceletters
Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
Monoalphabetic Cipher Security
 Now we have a total of 26!  4 x 1026 keys.
 With so many keys, it is secure against brute-force attacks.
 But not secure against some cryptanalytic attacks.
 Problem is language characteristics (frequency analysis of
alphabets)
Monoalphabetic Cipher Security-Language Statistics and
Cryptanalysis
 Human languages are not random.
 Letters are not equally frequently used.
 In English, E is by far the most common letter, followed by T, R,
N, I, O, A, S.
 Other letters like Z, J, K, Q, X are fairly rare.
 In addition to the frequency info of single letters, the frequency
info of two-letter (digram) or three-letter (trigram)
combinations can be used for the cryptanalysis
 Most frequent digrams - TH, HE, IN, ER, AN, RE, ED, ON, ES, ST,
EN, AT, TO, NT, HA, ND, OU, EA, NG, AS, OR, TI, IS, ET, IT, AR, TE,
SE, HI, OF
 Most frequent trigrams - THE, ING, AND, HER, ERE, ENT, THA,
NTH, WAS, ETH, FOR, DTH
Relative Frequency of Letters in English Text
Monoalphabetic Cipher Security- Example
 Consider the following ciphertext
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
 Count the relative letter frequencies
P 13.33 H 5.83 F 3.33 B 1.67 C 0.00
Z 11.67 D 5.00 W 3.33 G 1.67 K 0.00
S 8.33 E 5.00 Q 2.50 Y 1.67 L 0.00
U 8.33 V 4.17 T 2.50 I 0.83 N 0.00
O 7.50 X 4.17 A 1.67 J 0.83 R 0.00
M 6.67
Monoalphabetic Cipher Security- Example
 Consider the following ciphertext
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
 Guess {P, Z} = {e, t}
 Of double letters, ZW has highest frequency, so guess ZW = th
 and hence ZWP = the
 Next, notice the sequence ZWSZ in the first line. We do not
know that these four letters form a complete word, but if they
do, it is of the form th_t. If so, S equates with a.
Monoalphabetic Cipher Security- Example
 Consider the following ciphertext
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Monoalphabetic Cipher Security- Example
 Consider the following ciphertext
UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ
VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX
EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
Proceeding with trial and error finally get:
it was disclosed yesterday that several informal but
direct contacts have been made with political
representatives of the viet cong in moscow
Monoalphabetic ciphers are easy to break because they reflect the frequency
data of the original alphabet
To avoid frequency analysis
 Two method can used
 Encrypt multiple letters of plaintext – Playfair Cipher
 Use multiple cipher alphabets – Hill Cipher
Playfair Cipher
 Not even the large number of keys in a monoalphabetic cipher
provides security.

 One approach to improving security is to encrypt multiple
letters at a time.
 The Playfair Cipher is the best known such cipher which treats
digrams in the plaintext as single units and translates these units
into ciphertext digrams.
 Invented by Charles Wheatstone in 1854, but named after his
friend Baron Playfair.
Playfair Cipher
 The Playfair algorithm is based on the use of a 5 * 5 matrix of
letters (consider as key).
 The matrix is constructed by filling in the letters of the keyword
(Exclude duplicates) from left to right and from top to bottom,
and then filling in the remainder of the matrix with the
remaining letters in alphabetic order. The letters I and J count as
one letter.
key = MONARCHY
M O N A R
C H Y B D
E F G I/J K
L P Q S T
U V W X Z
Playfair Cipher- Matrix generation Example
key = KEYWORD
key = OCCURRENCE
Playfair Cipher- Matrix generation Example
key = ENGINEERING
key = MOONMISSION
Playfair Cipher- Encrypt Cipher
Plaintext is encrypted two letters at a time, according to the
following rules:
Playfair Cipher- Encrypt Cipher
 If both letters fall in the same row, replace each with the letter
to its right (circularly).
Playfair Cipher- Encrypt Cipher
 If both letters fall in the same column, replace each with the
Letter below it (circularly).
Playfair Cipher- Encrypt Cipher
Playfair Cipher- Encrypt Cipher
Playfair Cipher- Examples
Encrypted Message
te st th is pr oc es sx
pi tu pm gt ue lf gp xg
Playfair Cipher- Examples
Encrypted Message
co me to th ew in do wx
lc nk zk vf yo gq ce bw
Playfair Cipher- Examples
Playfair Cipher- Decrypt Cipher
Cypher text is decrypted two letters at a time, according to the
following rules:
1. If both letters fall in the same row, replace each with the letter
to its left (circularly).
2. If both letters fall in the same column, replace each with the
Letter above it (circularly).
3. if two letter are on different row and column
Playfair Cipher- Decrypt Examples
Ciphertext
pitu pmgt uelfgpxg
Key=“engineering”
Plaintext
TEST THIS PROCESSX
Playfair Cipher- Decrypt Examples
Playfair Cipher- is it Breakable?
Limitation
 Only 25 alphabets are supported.
 It does not support numeric characters.
 Only either upper cases or lower cases are supported.
 The use of special characters (such as blank space, newline,
punctuations, etc.) is prohibited.
 It does not support other languages, except English.
 Encryption of media files is also not supported.
GTU Question
 Encrypt the Message “Surgical Strike” with key “GUJAR” using
PLAYFAIR technique. [Winter 2018] [4 Marks]
 Explain Playfair Cipher in detail. Find out cipher text for the
following given plain text and key. [Winter 2017] [7 Marks]
 Key = GOVERNMENT
 Plain text = PLAYFAIR
 Use the key “hidden” and encrypt the message “Message” using
playfair cipher. [Summer 2019] [7 Marks]
 Explain playfair cipher substitution technique in detail. Find out
cipher text for the following given key and plaintext. [Summer
2017] [7 Marks]
 Key = ENGINEERING
 Plaintext=COMPUTER
GTU Question
 Perform encryption in Playfair Cipher algorithm with plain text as
“INFORMATION AND NETWORK SECURITY”, Keyword is
“MONARCHY”. (Note: 1.Put j and i both combine as a single field in
5*5 matrix) [ Winter 2019] [07 Marks]
Step1: Read Key and Text
Step2: Remove duplicates from Key
Step3: Convert Key and Text into Uppercase and whenever ‘J’ is
there, it is replace with ‘I’
Step 4: Store temporary those characters in A-Z are not part of
key (KEYMINUS)
Step5: Generate 5X5 matrix by taking output of step 2 and step
4
Step 6: Construct diagram and call playfair function to convert
into Ciphertext
for (i = 0; i < strlen(str); i++) {
if (str[i] == 'J') str[i] = 'I';
if (str[i + 1] == '0') playfair(str[i], 'X', key);
else {
if (str[i + 1] == 'J') str[i + 1] = 'I';
if (str[i] == str[i + 1]) playfair(str[i], 'X', key);
else {
playfair(str[i], str[i + 1], key);
i++;
}
}
}
Playfair function
Step 1 : Find the position of Diagram into Key matrix
void playfair(char ch1, char ch2, char key[MX][MX]) {
int i, j, w, x, y, z;
for (i = 0; i < MX; i++) {
for (j = 0; j < MX; j++) {
if (ch1 == key[i][j]) { // First char in diagram
w = i;
x = j;
} else if (ch2 == key[i][j]) { // second char in diagram
y = i;
z = j;
}
}
}
Playfair function
Step 2 : Both char in Diagram are in same row
if (w == y) {
if(choice==1){
//encryption --same row - move right // change column
x = (x + 1) % 5;
z = (z + 1) % 5;
}
else{
//decryption -- same row - move left
x = ((x - 1)+5)%5;
z = ((z - 1)+5)%5;
}
printf("%c%c", key[w][x], key[y][z]);
}
Playfair function
Step 3 : Both char in Diagram are in same Column
else if (x == z) {
if(choice==1){
//encryption --same col - move down //change row
w = (w + 1) % 5;
y = (y + 1) % 5;
}
else{
//Decryption --same col - move Up //change row
w = ((w - 1)+5)%5;
y = ((y - 1) +5)%5;
}
printf("%c%c", key[w][x], key[y][z]);
}
Playfair function
Step 4 : Both char in Diagram are not in same row and col
else {
printf("%c%c", key[w][z], key[y][x]);
}
Hill Cipher
 Hill Cipher was invented and developed in 1929 by Lester S. Hill.
 The Hill cipher is an example of a block cipher.
 A block cipher is a cipher in which groups of letters are
enciphered together in equal length blocks .
 The Hill cipher is a polygraphic substitution cipher built on
concepts from Linear Algebra.
 Key is represented in form of matrix (2 x2 or 3x3 , etc..) (Note:
Determinate of Key matrix must be non-zero)
 Each letter is represented by number 0 to 25 and calculation are
based on mod 26.
 The Hill cipher makes use of modulo arithmetic, matrix
multiplication, and matrix inverses; hence, it is a more
mathematical cipher than others
Hill Cipher - Encryption
 Encrypting with the Hill cipher is built on the following operation:
C = (K*P) mod 26
 Where K is our key matrix and P is the plaintext in vector form.
 Matrix multiplying these two terms produces the encrypted
ciphertext.
Example:
Key= HILL
Plaintext=exam
Key Matrix=
Plain Text =
Hill Cipher-Encryption
Hill Cipher – Encryption-Example -2
 Encrypting with the Hill cipher is built on the following operation:
C = (K*P) mod 26
 Where K is our key matrix and P is the plaintext in vector form.
 Matrix multiplying these two terms produces the encrypted
ciphertext.
Example:
Key= HILL
Plaintext=short example
Key Matrix=
Plain Text: =
Hill Cipher – Encryption-Example -2
ciphertext = "APADJ TFTWLFJ".
How to find 275 mod 26?
=275/26
=10.5769
10.5769-10
0.5769x26=15
Hill Cipher – Encryption-Example -2
ciphertext = "APADJ TFTWLFJ".
Hill Cipher – Encryption-Example -3
Hill Cipher – Encryption-Example -3
Hill Cipher – Encryption-Example -3
Hill Cipher – Encryption-Example -3
ciphertext = “FKMFIO".
Hill Cipher
Encryption Example
Using
3x3 Key Matrix
Hill Cipher - Encryption
 Encrypting with the Hill cipher is built on the following operation:
C = (K*P) mod 26
 Where K is our key matrix and P is the plaintext in vector form.
 Matrix multiplying these two terms produces the encrypted
ciphertext.
Example:
Key= BKAAUBCPC
Plaintext= retreat now
Key Matrix=
𝑩 𝑨 𝑪
𝑲 𝑼 𝑷
𝑨 𝑩 𝑪
=
𝟏 𝟎 𝟐
𝟏𝟎 𝟐𝟎 𝟏𝟓
𝟎 𝟏 𝟐
Plain Text =
𝒓
𝒆
𝒕
𝒓
𝒆
𝒂
𝒕
𝒏
𝒐
𝒘
𝒙
𝒙
=
𝟏𝟕
𝟒
𝟏𝟗
𝟏𝟕
𝟒
𝟎
𝟏𝟗
𝟏𝟑
𝟏𝟒
𝟐𝟐
𝟐𝟑
𝟐𝟑
Hill Cipher – Encryption
C= P*K mod 26
Hill Cipher – Encryption
C= P*K mod 26
Hill Cipher – Encryption
C= P*K mod 26
Hill Cipher – Encryption
C= P*K mod 26
Ciphertext=DPQRQ EVKPQ LR
Hill Cipher – Decryption
Hill Cipher – Decryption
Step 1: Calculate the multiplicative inverse for the determinant.
Step 2: Multiply it with Adjoin matrix
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
Hill Cipher – Decryption: Example 2x2 Key matrix
Step 1: Calculate the multiplicative inverse for the determinant.
1.1 Find Determinate of the Matrix
Key Matrix =
D=15
Hill Cipher – Decryption: Example 2x2 Key matrix
Step 2: Calculate the multiplicative inverse for the determinant.
1.2 Find multiplicative inverse of Determinate of the Matrix
dd-1  1 mod 26
d * d-1 mod 26 =1
= 15 * d-1 mod 26 =1 (Hit and trial Method)
If d-1 = 7 then 15*7 mod 26 = 105 mod 26=1
hence d-1 =7
Hill Cipher – Decryption: Example 2x2 Key matrix
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.1 Calculate Adjoin matrix
And for negative values, we have to add them with 26 to get the desired values
between 0 and 25 for use in the decryption formula.
Hill Cipher – Decryption: Example 2x2 Key matrix
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.2 Multiply d-1 with Adjoin matrix
Hill Cipher – Decryption: Example 2x2 Key matrix
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘ELSC’
Hill Cipher Decryption: Example 2
Key: HILL
Ciphertext: APADJ TFTWLFJ
Step 1: Calculate the multiplicative inverse for the determinant.
Step 2: Multiply it with Adjoin matrix
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
Hill Cipher – Decryption: Example 2
Step 1: Calculate the multiplicative inverse for the determinant.
1.1 Find Determinate of the Matrix
Key Matrix =
D=15
Hill Cipher – Decryption: Example :2
Step 2: Calculate the multiplicative inverse for the determinant.
1.2 Find multiplicative inverse of Determinate of the Matrix
dd-1  1 mod 26
d * d-1 mod 26 =1
= 15 * d-1 mod 26 =1 (Hit and trial Method)
If d-1 = 7 then 15*7 mod 26 = 105 mod 26=1
hence d-1 =7
Hill Cipher – Decryption: Example :2
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.1 Calculate Adjoin matrix
And for negative values, we have to add them with 26 to get the desired values
between 0 and 25 for use in the decryption formula.
Hill Cipher – Decryption: Example :2
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.2 Multiply d-1 with Adjoin matrix
Hill Cipher – Decryption: Example :2
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘APADJ TFTWLFJ’
Hill Cipher – Decryption: Example :2
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘APADJ TFTWLFJ’
Hill Cipher – Decryption: Example :2
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘APADJ TFTWLFJ’
Hill Cipher – Decryption: Example :2
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘APADJ TFTWLFJ’
Hill Cipher – Decryption: Example:2
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘APADJ TFTWLFJ’
Hill Cipher – Decryption: Example :2
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext as ‘APADJ TFTWLFJ’
Plain text: short example
Hill Cipher Decryption: Example 3
Key: CDDG
Ciphertext:FKMFIO
Step 1: Calculate the multiplicative inverse for the determinant.
Step 2: Multiply it with Adjoin matrix
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
Hill Cipher – Decryption: Example 3
Step 1: Calculate the multiplicative inverse for the determinant.
1.1 Find Determinate of the Matrix
Key Matrix =
D=3
𝐶 𝐷
𝐷 𝐺
=
2 3
3 6
2 3
3 6
= 2 ∗ 6 − 3 ∗ 3 = 3 𝑚𝑜𝑑 26 = 3
Hill Cipher – Decryption: Example :3
Step 2: Calculate the multiplicative inverse for the determinant.
1.2 Find multiplicative inverse of Determinate of the Matrix
dd-1  1 mod 26
d * d-1 mod 26 =1
= 3 * d-1 mod 26 =1 (Hit and trial Method)
If d-1 = 9 then 3*9 mod 26 = 27 mod 26=1
hence d-1 =9
Hill Cipher – Decryption: Example :2
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.1 Calculate Adjoin matrix
And for negative values, we have to add them with 26 to get the desired values
between 0 and 25 for use in the decryption formula.
𝑎𝑑𝑗
2 3
3 6
=
6 −3
−3 2
=
6 −3 + 26
−3 + 26 2
=
6 23
23 2
Hill Cipher – Decryption: Example :3
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.2 Multiply d-1 with Adjoin matrix
9 ×
6 23
23 2
𝑚𝑜𝑑 26 =
54 207
207 18
𝑚𝑜𝑑 26 =
2 25
25 18
If k =
2 3
3 6
, 𝑡ℎ𝑒𝑛 𝑘−1 =
2 25
25 18
Hill Cipher – Decryption: Example :3
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext = ‘FKMFIO’
2 25
25 18
𝐹
𝐾
=
2 25
25 18
5
10
mod 26
=
2 ∗ 5 + 25 ∗ 10
25 ∗ 5 + 18 ∗ 10
mod 26
=
260
305
𝑚𝑜𝑑 26
=
0
19
=
𝐴
𝑇
Hill Cipher – Decryption: Example :3
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext = ‘FKMFIO’
2 25
25 18
𝑀
𝐹
=
2 25
25 18
12
5
mod 26
=
2 ∗ 12 + 25 ∗ 5
25 ∗ 12 + 18 ∗ 5
mod 26
=
149
390
𝑚𝑜𝑑 26
=
19
0
=
𝑇
𝐴
Hill Cipher – Decryption: Example :3
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
ciphertext = ‘FKMFIO’
2 25
25 18
𝐼
𝑂
=
2 25
25 18
8
14
mod 26
=
2 ∗ 8 + 25 ∗ 14
25 ∗ 8 + 18 ∗ 14
mod 26
=
366
452
𝑚𝑜𝑑 26
=
2
10
=
𝐶
𝐾
Hill Cipher
Decryption Example
Using
3x3 Key Matrix
Hill Cipher Decryption
Key: AHELATPBA
Ciphertext: SYICHOLER
Step 1: Calculate the multiplicative inverse for the determinant.
Step 2: Multiply it with Adjoin matrix
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext
Hill Cipher – Decryption: Example
Step 1: Calculate the multiplicative inverse for the determinant.
1.1 Find Determinate of the Matrix
𝐶 𝐷
𝐷 𝐺
=
2 3
3 6
Hill Cipher – Decryption: Example
Step 1: Calculate the multiplicative inverse for the determinant.
1.1 Find Determinate of the Matrix
D=11
Hill Cipher – Decryption: Example
Step 2: Calculate the multiplicative inverse for the determinant.
1.2 Find multiplicative inverse of Determinate of the Matrix
dd-1  1 mod 26
d * d-1 mod 26 =1
= 11 * d-1 mod 26 =1 (Hit and trial Method)
If d-1 = 19 then 11*19 mod 26 = 209 mod 26=1
hence d-1 =19
Hill Cipher – Decryption: Example
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.1 Calculate Adjoin matrix (Method 1)
Hill Cipher – Decryption: Example
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.1 Calculate Adjoin matrix (Method 2)
First calculate cofactor matrix
Then transpose the cofactor matrix
Hill Cipher – Decryption: Example
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.1 Calculate Adjoin matrix (Using Method 1)
And for negative values, we have to add them with 26 to get the desired values
between 0 and 25 for use in the decryption formula.
Hill Cipher – Decryption: Example
Step 2: Multiply multiplicative inverse of the determinant with
adjoin matrix
2.2 Multiply d-1 with Adjoin matrix
Hill Cipher – Decryption: Example
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext ciphertext = ‘SYICHOLER’
Hill Cipher – Decryption: Example
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext ciphertext = ‘SYICHOLER’
Hill Cipher – Decryption: Example
Step 3: Multiple inverse key matrix with Cipher text matrix to
obtain plaintext ciphertext = ‘SYICHOLER’
Plaintext=we are safe
Cryptanalysis of Hill Cipher
• As with Playfair, the strength of the Hill cipher is
that it completely hides single-letter frequencies.
Indeed, with Hill, the use of a larger matrix hides
more frequency information.
• Thus, a 3*3 Hill cipher hides not only single-letter
but also two-letter frequency information
• The Hill Cipher's weaknesses to the known-
plaintext attack is considered as its most
important security imperfection since it can be
cracked by taking n distinct pairs of plaintext
and corresponding cipher-text
GTU Question
• Encrypt the message "meet me at the usual place " using the Hill
cipher with the key
9 4
5 7
[winter 2018] [7 Marks]
• Given key K=
17 17 5
21 18 21
2 2 19
and plaintext =”ney”. Find out the
ciphertext applying Hill Cipher. [ 7 Marks] [Summer 2019]
• Encrypt the message “GTU Examination” using the Hill cipher
algorithm with the key matrix
5 17
4 15
. Show your calculations
and the result. [Winter 2019] [7 marks]
Polyalphabetic Cipher
If two letters are the same in the ciphertext it does not mean
they must decipher to the same plaintext letter.
Polyalphabetic Cipher –Vigenere Cipher
One of the simplest, polyalphabetic ciphers is the Vigenère cipher
Method-1
 It uses
Vigenere’ table
of size 26 x26
 Each row one
shift is made
towards right in
Cyclic Manner
Polyalphabetic Cipher –Vigenere Cipher
Polyalphabetic Cipher –Vigenere Cipher
Ciphertext=R
Polyalphabetic Cipher –Vigenere Cipher
Ciphertext=RW
Ciphertext=RWXOXCPOJ
Polyalphabetic Cipher –Vigenere Cipher
Ciphertext=RW
Ciphertext=RWXOXCPOJ
Polyalphabetic Cipher –Vigenere Cipher
Decryption is performed by going
to the row in the table
corresponding to the key, finding
the position of the ciphertext
letter in this row, and then using
the column’s label as the
plaintext.
Polyalphabetic Cipher –Vigenere Cipher
Polyalphabetic Cipher –Vigenere Cipher
Polyalphabetic Cipher –Vigenere Cipher
Polyalphabetic Cipher –Vigenere Cipher
Method-2
 When the vigenere table is not given, the encryption and decryption are done
by Vigenar algebraically formula in this method (convert the letters (A-Z) into
the numbers (0-25)).
 It generate Keystream from KEY by repeatedly writing key until length of
keystream and Plaintext/Ciphertext are equal
 Encryption
Ci = (Pi + Ki) mod 26
 Decryption
Pi = (Ci - Ki) mod 26
Polyalphabetic Cipher –Vigenere Cipher
Polyalphabetic Cipher –Vigenere Cipher
Method-2
 Encryption
Ci = (Pi + Ki) mod 26
PLAINTEXT G I V E M O N E Y
06 08 21 04 12 14 13 04 24
KEY L O C K L O C K L
11 14 2 10 11 14 2 10 11
CIPHERTEXT
Polyalphabetic Cipher –Vigenere Cipher
Method-2
 Encryption
Ci = ( Pi+ Ki) mod 26
PLAINTEXT G I V E M O N E Y
06 08 21 04 12 14 13 04 24
KEY L O C K L O C K L
11 14 2 10 11 14 2 10 11
CIPHERTEXT R W X O X C P O J
Polyalphabetic Cipher –Vigenere Cipher
Method-2
 Decryption
Pi = (Ci - Ki) mod 26
Ciphertext R W X O X C P O J
17 22 23 14 23 02 15 14 09
KEY L O C K L O C K L
11 14 2 10 11 14 2 10 11
Plaintext G I V E M O N E Y
Cryptanalysis of Vigenere Cipher
 The Vigenere Cipher initially seems very secure, however it can be
broken fairly easily once the length of the keyword is known.
 If we know that the length of the keyword is n, we can break the
ciphertext into n cosets and attack the cipher using frequency
analysis if the ciphertext sample is long enough.
Kasiski tests to determine length of key
Cryptanalysis of Vigenere Cipher
Kasiski tests to determine length of key
Example:
 The second group of repeated letters IVE occurs 12 letters after the
first.
 The third group of letters appears 6 letters after the first.
 GCD(6,12) is 6, this suggests that the length of the keyword is 6.
Plaintext T H E C H I L D I S F A T H E R O F T H E M A N
Keyword P O E T R Y P O E T R Y P O E T R Y P O E T R Y
Ciphertext I V E V Y G A R M L M Y I V E K F D I V E F R L
Cryptanalysis of Vigenere Cipher
 The periodic nature of the keyword can be eliminated by using a
nonrepeating keyword that is as long as the message itself.
 Vigenère proposed what is referred to as an autokey system, in
which a keyword is concatenated with the plaintext itself to
provide a running key.
 For our example,
 Even this scheme is vulnerable to cryptanalysis.
 Because the key and the plaintext share the same frequency
distribution of letters, a statistical technique can be applied.
key: deceptivewearediscoveredsav
plaintext: wearediscoveredsaveyourself
ciphertext: ZICVTWQNGKZEIIGASXSTSLVVWLA
Vernam Cipher
 The Vernam cipher was created by Gilbert Vernam
 Keyword is long as the plaintext (has no statistical relationship
with plaintext)
 The essence of this technique is the means of construction of the
key.
 Vernam proposed the use of a running loop of tape that eventually
repeated the key, so that in fact the system worked with a very
long but repeating keyword.
 Each character of the plaintext and the key is converted to binary
using a character coding system like ASCII.
 The plaintext binary is then XOR'd with the key binary to produce a
new binary value.
 This is then converted to a character and is part of the ciphertext.
 The same technique is applied in reverse to decrypt information.
Vernam Cipher
Vernam Cipher
Vernam Cipher-Example 1
Decryption
C-0010011111
K-1100110101
----------------------
P-1110101010
Vernam Cipher-Example 2
Decryption
C-01001001000010011111
K-11001101011100110101
----------------------
P-10000100011110101010
Vernam Cipher
 Although such a scheme, with a long key, presents formidable
cryptanalytic difficulties, it can be broken with sufficient
ciphertext, the use of known or probable plaintext sequences, or
both.
 Solution: One- Time Pad
One Time Pad
 An Army Signal Corp officer, Joseph Mauborgne, proposed an
improvement to the Vernam cipher that yields the ultimate in
security.
 Mauborgne suggested using a random key that is as long as the
message, so that the key need not be repeated.
 In addition, the key is to be used to encrypt and decrypt a single
message, and then is discarded,
 Each new message requires a new key of the same length as the
new message. Such a scheme, known as a one-time pad, is
unbreakable.
 It produces random output that bears no statistical relationship to
the plaintext.
One Time Pad
One Time Pad
One Time Pad
The one-time pad is the only cryptosystem that exhibits what is referred
to as perfect secrecy.
Transposition
Transposition
Transposition
Rail Fence Transposition - Decryption
Ciphertext: MEMATEAKETETHPR
Create a table
Number of column = number of letter in Ciphertext
Number of row = depth
Put X in Zig Zag fashion
X X X X X X X X
X X X X X X X
Rail Fence Transposition - Decryption
Ciphertext: MEMATEAKETETHPR
Now, write down Ciphertext, row by row where X is written
Then, write down letter in Zig-Zag fashion
Plaintext: MEETMEATTHEPARK
M E M A T E A K
E T E T H P R
Rail Fence Transposition - Example
Ciphertext: HORELOLLWD
Plaintext: THIS IS A QUICK WAY TO MIX
Depth: 3
Ciphertext: TIUWOHSSQIKATMXIACYI
Plaintext: Hello World
Depth: 3
Rail Fence Transposition
Attacker can try
for different
depth and find
the plain text
Row/Column Transposition
 Plaintext is written in tabular form row by row where length of row
determined by length of key.
 Ciphertext is read out column by column where order of column is
specified by Key.
 Key = permutation of order of Column
Example:
Key=ZEBRAS (the key is 6 letters long hence there are 6 column in
Plaintext table)
Row/Column Transposition-Encryption
Row/Column Transposition-Decryption
Row/Column Transposition-Decryption
Row/Column Transposition-Encryption
In this example, the key is 4312567. To encrypt, start with the column that is labeled
1, in this case column 3. Write down all the letters in that column. Proceed to column
4, which is labeled 2, then column 2, then column 1, then columns 5, 6, and 7
Cryptanalysis of Row/Column Transposition
 For columnar/Row transposition, cryptanalysis is fairly straightforward and
involves laying out the ciphertext in a matrix and playing around with column
positions.
 Digram and trigram frequency tables can be useful.
Solution: Multiple transposition
Double Row/Column Transposition
 The transposition cipher can be made significantly more secure by performing
more than one stage of transposition.
 The result is a more complex permutation that is not easily reconstructed.
1st level
transposition
2nd level
transposition
Double Row/Column Transposition
 To visualize the result of this double transposition, designate the letters in the
original plaintext message by the numbers designating their position.
 Thus, with 28 letters in the message, the original sequence of letters is.
 After the first transposition, we have
 which has a somewhat regular structure. But after the second transposition,
we have
 This is a much less structured permutation and is much more difficult to
cryptanalyze.

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Feistel cipher
Feistel cipherFeistel cipher
Feistel cipher
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Double DES & Triple DES
Double DES & Triple DESDouble DES & Triple DES
Double DES & Triple DES
 
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
CRYPTOGRAPHY & NETWORK SECURITY -  unit 1CRYPTOGRAPHY & NETWORK SECURITY -  unit 1
CRYPTOGRAPHY & NETWORK SECURITY - unit 1
 
RSA Algorithm
RSA AlgorithmRSA Algorithm
RSA Algorithm
 
Asymmetric Cryptography.pptx
Asymmetric Cryptography.pptxAsymmetric Cryptography.pptx
Asymmetric Cryptography.pptx
 
Diffie-hellman algorithm
Diffie-hellman algorithmDiffie-hellman algorithm
Diffie-hellman algorithm
 
Introduction to Cryptography
Introduction to CryptographyIntroduction to Cryptography
Introduction to Cryptography
 
Public key cryptography and RSA
Public key cryptography and RSAPublic key cryptography and RSA
Public key cryptography and RSA
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
2. Stream Ciphers
2. Stream Ciphers2. Stream Ciphers
2. Stream Ciphers
 
Cryptography
CryptographyCryptography
Cryptography
 
symmetric key encryption algorithms
 symmetric key encryption algorithms symmetric key encryption algorithms
symmetric key encryption algorithms
 
Symmetric and asymmetric key
Symmetric and asymmetric keySymmetric and asymmetric key
Symmetric and asymmetric key
 
UNIT- I & II_ 3R-Cryptography-Lectures_2021-22_VSM.pdf
UNIT- I & II_ 3R-Cryptography-Lectures_2021-22_VSM.pdfUNIT- I & II_ 3R-Cryptography-Lectures_2021-22_VSM.pdf
UNIT- I & II_ 3R-Cryptography-Lectures_2021-22_VSM.pdf
 
Key Management and Distribution
Key Management and DistributionKey Management and Distribution
Key Management and Distribution
 
Cryptography
CryptographyCryptography
Cryptography
 
Asymmetric Cryptography
Asymmetric CryptographyAsymmetric Cryptography
Asymmetric Cryptography
 
Cryptography
CryptographyCryptography
Cryptography
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key Exchange
 

Similar a Unit 1

Symmetric ciphermodel
Symmetric ciphermodelSymmetric ciphermodel
Symmetric ciphermodelpriyapavi96
 
Cyptography and network security
Cyptography and network securityCyptography and network security
Cyptography and network securityPriyanka Karancy
 
Cryptography by Durlab Kumbhakar
Cryptography by Durlab KumbhakarCryptography by Durlab Kumbhakar
Cryptography by Durlab KumbhakarDurlove Kumbhakar
 
Chapter 2 part 1.ppt
Chapter 2 part 1.pptChapter 2 part 1.ppt
Chapter 2 part 1.pptMikiAbera
 
Cryptography
CryptographyCryptography
Cryptographyprasham95
 
Information and network security 11 cryptography and cryptanalysis
Information and network security 11 cryptography and cryptanalysisInformation and network security 11 cryptography and cryptanalysis
Information and network security 11 cryptography and cryptanalysisVaibhav Khanna
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniquesbabak danyal
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Securitybabak danyal
 
Computer Security (Cryptography) Ch01
Computer Security (Cryptography) Ch01Computer Security (Cryptography) Ch01
Computer Security (Cryptography) Ch01Saif Kassim
 
CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...
CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...
CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...ams1ams11
 

Similar a Unit 1 (20)

Unit-2-IS (1).pdf
Unit-2-IS (1).pdfUnit-2-IS (1).pdf
Unit-2-IS (1).pdf
 
Symmetric ciphermodel
Symmetric ciphermodelSymmetric ciphermodel
Symmetric ciphermodel
 
Cyptography and network security
Cyptography and network securityCyptography and network security
Cyptography and network security
 
Day5
Day5Day5
Day5
 
Cns 1
Cns 1Cns 1
Cns 1
 
Cryptography by Durlab Kumbhakar
Cryptography by Durlab KumbhakarCryptography by Durlab Kumbhakar
Cryptography by Durlab Kumbhakar
 
Chapter 2 part 1.ppt
Chapter 2 part 1.pptChapter 2 part 1.ppt
Chapter 2 part 1.ppt
 
Cryptography
CryptographyCryptography
Cryptography
 
Information and network security 11 cryptography and cryptanalysis
Information and network security 11 cryptography and cryptanalysisInformation and network security 11 cryptography and cryptanalysis
Information and network security 11 cryptography and cryptanalysis
 
Module 1.pptx
Module 1.pptxModule 1.pptx
Module 1.pptx
 
Ch02 classic nemo
Ch02 classic nemoCh02 classic nemo
Ch02 classic nemo
 
Cns Chapter 2
Cns Chapter 2Cns Chapter 2
Cns Chapter 2
 
Fundamentals of cryptography
Fundamentals of cryptographyFundamentals of cryptography
Fundamentals of cryptography
 
Iss lecture 2
Iss lecture 2Iss lecture 2
Iss lecture 2
 
Er. Sanjeev Raaz
Er. Sanjeev RaazEr. Sanjeev Raaz
Er. Sanjeev Raaz
 
Cns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption TechniquesCns 13f-lec03- Classical Encryption Techniques
Cns 13f-lec03- Classical Encryption Techniques
 
Classical Encryption Techniques in Network Security
Classical Encryption Techniques in Network SecurityClassical Encryption Techniques in Network Security
Classical Encryption Techniques in Network Security
 
Computer Security (Cryptography) Ch01
Computer Security (Cryptography) Ch01Computer Security (Cryptography) Ch01
Computer Security (Cryptography) Ch01
 
CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...
CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...
CH2 Stallings,_William_Computer_Security_Principles_and_Practice_Pearson [54-...
 
Unit 2
Unit 2Unit 2
Unit 2
 

Último

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...ranjana rawat
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 

Último (20)

Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 

Unit 1

  • 1. Information Security UNIT 1: SYMMETRIC CIPHER MODEL, CRYPTOGRAPHY, CRYPTANALYSIS AND ATTACKS; SUBSTITUTION AND TRANSPOSITION TECHNIQUES REFERENCE BOOK- CRYPTOGRAPHY AND NETWORK SECURITY, PRINCIPLES AND PRACTICE SIXTH EDITION, WILLIAM STALLINGS, PEARSON CHAPTER -2 CLASSICAL ENCRYPTION TECHNIQUES
  • 2. Road Map  Symmetric Cipher Model: Cryptography, Cryptanalysis and Attacks  Substitution techniques  Transposition techniques
  • 3. Basic Terminology  Plaintext - the original message  Ciphertext – encrypted or the coded message  enciphering (encryption) - The process of converting from plaintext to ciphertext  Encryption algorithm: performs encryption  Two inputs: a plaintext and a secret key  deciphering (decryption) – process of recovering ciphertext from plaintext  Decryption algorithm: performs decryption  Two inputs: ciphertext and secret key  Secret key: key used for encryption and decryption  If same key is used then known as symmetric cryptology  If Different key is used then known as asymmetric cryptology
  • 4. Basic Terminology  Cipher – a particular algorithm (cryptographic system)  cryptography - study of algorithms used in encryption  cryptanalysis (codebreaking) - the study of techniques used in decryption without knowing plaintext (i.e. he study of the cryptographic algorithm and the breaking of those secret codes)  cryptology - the field of both cryptography and cryptanalysis  The person practicing Cryptanalysis is called a Cryptanalyst.  It helps us to better understand the cryptosystems and also helps us improve the system by finding any weak point and thus work on the algorithm to create a more secure secret code.  For example, a Cryptanalyst might try to decipher a ciphertext to derive the plaintext. It can help us to deduce the plaintext or the encryption key.
  • 5. Symmetric Cypher model (Conventional Encryption)
  • 6. Symmetric Cypher model (Conventional Encryption)
  • 7. Symmetric Cypher model (Conventional Encryption) X=D(K,Y)
  • 8. Requirement and Assumption  Requirement  a strong encryption algorithm-given algorithm and cipher text , attacker can not obtained key or plain text  a shared secret key: Sender and receiver must have obtained copies of the secret key in a secure fashion and must keep the key secure. Y = EK(X) X = DK(Y)  Assumption  encryption algorithm is known  a secure channel to distribute key
  • 9. Symmetric encryption Mathematically: Y = EK(X) or Y = E(K, X) X = DK(Y) or X = D(K, Y) X = plaintext Y = ciphertext K = secret key E = encryption algorithm D = decryption algorithm Both E and D are known to public
  • 10. Model of Symmetric Cryptosystem
  • 11. Model of Symmetric Cryptosystem X X
  • 12. Cryptography Cryptographic systems are characterized along three independent dimensions: 1. The type of operations used for transforming plaintext to ciphertext.  All encryption algorithms are based on two general principle:  Substitution - in which each element in the plaintext is mapped into another element  transposition, in which elements in the plaintext are rearranged.  The fundamental requirement is that no information be lost. (i.e., that all operations are reversible).  Most systems, referred to as product systems, involve multiple stages of substitutions and transpositions
  • 13. Cryptography Cryptographic systems are characterized along three independent dimensions: 2. The number of keys used.  If both sender and receiver use the same key, the system is referred to as symmetric, single-key, secret-key, or conventional Encryption  If the sender and receiver use different keys, the system is referred to as asymmetric, two-key, or public-key encryption.
  • 14. Cryptography Cryptographic systems are characterized along three independent dimensions: 3. The method used to process plaintext –block cipher, stream cipher
  • 16. Types of Cryptanalytic Attacks  ciphertext only  know a) algorithm b) ciphertext  known plaintext  know some given plaintext/ciphertext pairs  chosen plaintext  select plaintext and obtain ciphertext  chosen ciphertext  select ciphertext and obtain plaintext  chosen text  select either plaintext or ciphertext to en/decrypt to attack cipher
  • 17. Types of Cryptanalytic Attacks: Ciphertext only  In the ‘cipher-only’ attack, the attacker knows the ciphertext of various messages which have been encrypted using the same encryption algorithm.  The attacker’s challenge is to figure the ‘key’ which can then be used to decrypt all messages.  Only relatively weak algorithms fail to withstand a ciphertext- only attack.
  • 18. Types of Cryptanalytic Attacks: Known Plaintext (KPA)  The attacker has a collection of plaintext-ciphertext pairs and is trying to find the key or to decrypt some other ciphertext that has been encrypted with the same key.  Example: linear cryptanalysis against block ciphers.
  • 19. Types of Cryptanalytic Attacks: Chosen Plaintext  In this type of attack, the attacker chooses random plaintexts and obtains the corresponding ciphertexts and tries to find the encryption key.  Its very simple to implement like KPA but the success rate is quite low.  Example: differential cryptanalysis applied against block ciphers as well as hash functions.  A popular public key cryptosystem, RSA is also vulnerable to chosen- plaintext attacks.
  • 20. Types of Cryptanalytic Attacks: Chosen Ciphertext  In this type of attack, the attacker chooses random ciphertexts and obtains the corresponding plaintexts and tries to find the encryption key.
  • 21. Types of Cryptanalytic Attacks: Chosen text
  • 22. Unconditionally secure algorithm  An encryption scheme is unconditionally secure if the ciphertext generated by the scheme does not contain enough information to determine uniquely the corresponding plaintext, no matter how much ciphertext is available.  That is, no matter how much time an opponent has, it is impossible for him or her to decrypt the ciphertext simply because the required information is not there.  With the exception of a scheme known as the one-time pad, there is no encryption algorithm that is unconditionally secure.  i.e. no matter how much computer power is available, the cipher cannot be broken since the ciphertext provides insufficient information to uniquely determine the corresponding plaintext.
  • 23. Computationally secure algorithm  An encryption scheme is said to be computationally secure if either of the foregoing two criteria are met. 1. The cost of breaking the cipher exceeds the value of the encrypted information. 2. The time required to break the cipher exceeds the useful lifetime of the information.  Unfortunately, it is very difficult to estimate the amount of effort required to cryptanalyze ciphertext successfully  i.e. given limited computing resources (eg time needed for calculations is greater than age of universe), the cipher cannot be broken
  • 24. Brute Force Attack  Try every key to decipher the ciphertext.  On average, need to try half of all possible keys  Time needed proportional to size of key space Key Size (bits) Number of Alternative Keys Time required at 1 decryption/µs Time required at 106 decryptions/µs 32 232 = 4.3  109 231 µs = 35.8 minutes 2.15 milliseconds 56 256 = 7.2  1016 255 µs = 1142 years 10.01 hours 128 2128 = 3.4  1038 2127 µs = 5.4  1024 years 5.4  1018 years 168 2168 = 3.7  1050 2167 µs = 5.9  1036 years 5.9  1030 years 26 characters (permutation) 26! = 4  1026 2  1026 µs = 6.4  1012 years 6.4  106 years
  • 25. Road Map  Symmetric Cipher Model: Cryptography, Cryptanalysis and Attacks  Substitution techniques  Transposition techniques
  • 26. Substitution techniques  A substitution technique is one in which the letters of plaintext are replaced by other letters or by numbers or symbols.  If the plaintext is viewed as a sequence of bits, then substitution involves replacing plaintext bit patterns with ciphertext bit patterns. A substitution cipher replaces one symbol with another.
  • 27. Caesar Cipher  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 three places further down the alphabet.  Note that the alphabet is wrapped around, so that the letter following Z is A.
  • 28. Caesar Cipher Caesar ciphers are sometimes referred to as shift ciphers or Additive cipher.
  • 30. Caesar Cipher  A shift may be of any amount, so that the general Caesar algorithm is  where k takes on a value in the range 1 to 25. The decryption algorithm is simply
  • 31. Caesar Cipher: Example Use the Caesar cipher with key = 15 to encrypt the message “hello”. We apply the encryption algorithm to the plaintext, character by character: Solution
  • 32. Caesar Cipher: Example Use the Caesar cipher with key = 15 to decrypt the message “WTAAD”. We apply the decryption algorithm to the plaintext character by character: Solution
  • 33. Cryptanalysis of Caesar Cipher  brute-force cryptanalysis is easily performed: simply try all the 25 possible keys.  Three important characteristics of this problem enabled us to use a brute-force cryptanalysis:  The encryption and decryption algorithms are known.  There are only 25 keys to try.  The language of the plaintext is known and easily recognizable.
  • 34. Brute force attack on Caesar Cipher
  • 35. Cryptanalysis of Caesar Cipher  Three important characteristics of this problem enabled us to use a brute-force cryptanalysis:  The encryption and decryption algorithms are known.  There are only 25 keys to try.  The language of the plaintext is known and easily recognizable.  The third characteristic is also significant. 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.
  • 36. Monoalphabetic Cipher (simple substitution) 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. For example, if S = {a, b, c}, there are six permutations of S: abc, acb, bac, bca, cab, cba In general, there are n! permutations of a set of n elements, because the first element can be chosen in one of n ways, the second in n - 1 ways, the third in n – 2 ways, and so on
  • 37. Monoalphabetic Cipher (simple substitution)  Each plaintext letter maps to a different random ciphertext letter .  Hence key is 26 letters long Plain: abcdefghijklmnopqrstuvwxyz Cipher: DKVQFIBJWPESCXHTMYAUOLRGZN  “Cipher” line can be any permutation of the 26 alphabetic char Plaintext: ifwewishtoreplaceletters Ciphertext: WIRFRWAJUHYFTSDVFSFUUFYA
  • 38. Monoalphabetic Cipher Security  Now we have a total of 26!  4 x 1026 keys.  With so many keys, it is secure against brute-force attacks.  But not secure against some cryptanalytic attacks.  Problem is language characteristics (frequency analysis of alphabets)
  • 39. Monoalphabetic Cipher Security-Language Statistics and Cryptanalysis  Human languages are not random.  Letters are not equally frequently used.  In English, E is by far the most common letter, followed by T, R, N, I, O, A, S.  Other letters like Z, J, K, Q, X are fairly rare.  In addition to the frequency info of single letters, the frequency info of two-letter (digram) or three-letter (trigram) combinations can be used for the cryptanalysis  Most frequent digrams - TH, HE, IN, ER, AN, RE, ED, ON, ES, ST, EN, AT, TO, NT, HA, ND, OU, EA, NG, AS, OR, TI, IS, ET, IT, AR, TE, SE, HI, OF  Most frequent trigrams - THE, ING, AND, HER, ERE, ENT, THA, NTH, WAS, ETH, FOR, DTH
  • 40. Relative Frequency of Letters in English Text
  • 41. Monoalphabetic Cipher Security- Example  Consider the following ciphertext UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ  Count the relative letter frequencies P 13.33 H 5.83 F 3.33 B 1.67 C 0.00 Z 11.67 D 5.00 W 3.33 G 1.67 K 0.00 S 8.33 E 5.00 Q 2.50 Y 1.67 L 0.00 U 8.33 V 4.17 T 2.50 I 0.83 N 0.00 O 7.50 X 4.17 A 1.67 J 0.83 R 0.00 M 6.67
  • 42. Monoalphabetic Cipher Security- Example  Consider the following ciphertext UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ  Guess {P, Z} = {e, t}  Of double letters, ZW has highest frequency, so guess ZW = th  and hence ZWP = the  Next, notice the sequence ZWSZ in the first line. We do not know that these four letters form a complete word, but if they do, it is of the form th_t. If so, S equates with a.
  • 43. Monoalphabetic Cipher Security- Example  Consider the following ciphertext UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ
  • 44. Monoalphabetic Cipher Security- Example  Consider the following ciphertext UZQSOVUOHXMOPVGPOZPEVSGZWSZOPFPESXUDBMETSXAIZ VUEPHZHMDZSHZOWSFPAPPDTSVPQUZWYMXUZUHSX EPYEPOPDZSZUFPOMBZWPFUPZHMDJUDTMOHMQ Proceeding with trial and error finally get: it was disclosed yesterday that several informal but direct contacts have been made with political representatives of the viet cong in moscow Monoalphabetic ciphers are easy to break because they reflect the frequency data of the original alphabet
  • 45. To avoid frequency analysis  Two method can used  Encrypt multiple letters of plaintext – Playfair Cipher  Use multiple cipher alphabets – Hill Cipher
  • 46. Playfair Cipher  Not even the large number of keys in a monoalphabetic cipher provides security.   One approach to improving security is to encrypt multiple letters at a time.  The Playfair Cipher is the best known such cipher which treats digrams in the plaintext as single units and translates these units into ciphertext digrams.  Invented by Charles Wheatstone in 1854, but named after his friend Baron Playfair.
  • 47. Playfair Cipher  The Playfair algorithm is based on the use of a 5 * 5 matrix of letters (consider as key).  The matrix is constructed by filling in the letters of the keyword (Exclude duplicates) from left to right and from top to bottom, and then filling in the remainder of the matrix with the remaining letters in alphabetic order. The letters I and J count as one letter. key = MONARCHY M O N A R C H Y B D E F G I/J K L P Q S T U V W X Z
  • 48. Playfair Cipher- Matrix generation Example key = KEYWORD key = OCCURRENCE
  • 49. Playfair Cipher- Matrix generation Example key = ENGINEERING key = MOONMISSION
  • 50. Playfair Cipher- Encrypt Cipher Plaintext is encrypted two letters at a time, according to the following rules:
  • 51. Playfair Cipher- Encrypt Cipher  If both letters fall in the same row, replace each with the letter to its right (circularly).
  • 52. Playfair Cipher- Encrypt Cipher  If both letters fall in the same column, replace each with the Letter below it (circularly).
  • 55. Playfair Cipher- Examples Encrypted Message te st th is pr oc es sx pi tu pm gt ue lf gp xg
  • 56. Playfair Cipher- Examples Encrypted Message co me to th ew in do wx lc nk zk vf yo gq ce bw
  • 58. Playfair Cipher- Decrypt Cipher Cypher text is decrypted two letters at a time, according to the following rules: 1. If both letters fall in the same row, replace each with the letter to its left (circularly). 2. If both letters fall in the same column, replace each with the Letter above it (circularly). 3. if two letter are on different row and column
  • 59. Playfair Cipher- Decrypt Examples Ciphertext pitu pmgt uelfgpxg Key=“engineering” Plaintext TEST THIS PROCESSX
  • 61. Playfair Cipher- is it Breakable? Limitation  Only 25 alphabets are supported.  It does not support numeric characters.  Only either upper cases or lower cases are supported.  The use of special characters (such as blank space, newline, punctuations, etc.) is prohibited.  It does not support other languages, except English.  Encryption of media files is also not supported.
  • 62. GTU Question  Encrypt the Message “Surgical Strike” with key “GUJAR” using PLAYFAIR technique. [Winter 2018] [4 Marks]  Explain Playfair Cipher in detail. Find out cipher text for the following given plain text and key. [Winter 2017] [7 Marks]  Key = GOVERNMENT  Plain text = PLAYFAIR  Use the key “hidden” and encrypt the message “Message” using playfair cipher. [Summer 2019] [7 Marks]  Explain playfair cipher substitution technique in detail. Find out cipher text for the following given key and plaintext. [Summer 2017] [7 Marks]  Key = ENGINEERING  Plaintext=COMPUTER
  • 63. GTU Question  Perform encryption in Playfair Cipher algorithm with plain text as “INFORMATION AND NETWORK SECURITY”, Keyword is “MONARCHY”. (Note: 1.Put j and i both combine as a single field in 5*5 matrix) [ Winter 2019] [07 Marks]
  • 64. Step1: Read Key and Text Step2: Remove duplicates from Key Step3: Convert Key and Text into Uppercase and whenever ‘J’ is there, it is replace with ‘I’ Step 4: Store temporary those characters in A-Z are not part of key (KEYMINUS) Step5: Generate 5X5 matrix by taking output of step 2 and step 4 Step 6: Construct diagram and call playfair function to convert into Ciphertext
  • 65. for (i = 0; i < strlen(str); i++) { if (str[i] == 'J') str[i] = 'I'; if (str[i + 1] == '0') playfair(str[i], 'X', key); else { if (str[i + 1] == 'J') str[i + 1] = 'I'; if (str[i] == str[i + 1]) playfair(str[i], 'X', key); else { playfair(str[i], str[i + 1], key); i++; } } }
  • 66. Playfair function Step 1 : Find the position of Diagram into Key matrix void playfair(char ch1, char ch2, char key[MX][MX]) { int i, j, w, x, y, z; for (i = 0; i < MX; i++) { for (j = 0; j < MX; j++) { if (ch1 == key[i][j]) { // First char in diagram w = i; x = j; } else if (ch2 == key[i][j]) { // second char in diagram y = i; z = j; } } }
  • 67. Playfair function Step 2 : Both char in Diagram are in same row if (w == y) { if(choice==1){ //encryption --same row - move right // change column x = (x + 1) % 5; z = (z + 1) % 5; } else{ //decryption -- same row - move left x = ((x - 1)+5)%5; z = ((z - 1)+5)%5; } printf("%c%c", key[w][x], key[y][z]); }
  • 68. Playfair function Step 3 : Both char in Diagram are in same Column else if (x == z) { if(choice==1){ //encryption --same col - move down //change row w = (w + 1) % 5; y = (y + 1) % 5; } else{ //Decryption --same col - move Up //change row w = ((w - 1)+5)%5; y = ((y - 1) +5)%5; } printf("%c%c", key[w][x], key[y][z]); }
  • 69. Playfair function Step 4 : Both char in Diagram are not in same row and col else { printf("%c%c", key[w][z], key[y][x]); }
  • 70. Hill Cipher  Hill Cipher was invented and developed in 1929 by Lester S. Hill.  The Hill cipher is an example of a block cipher.  A block cipher is a cipher in which groups of letters are enciphered together in equal length blocks .  The Hill cipher is a polygraphic substitution cipher built on concepts from Linear Algebra.  Key is represented in form of matrix (2 x2 or 3x3 , etc..) (Note: Determinate of Key matrix must be non-zero)  Each letter is represented by number 0 to 25 and calculation are based on mod 26.  The Hill cipher makes use of modulo arithmetic, matrix multiplication, and matrix inverses; hence, it is a more mathematical cipher than others
  • 71. Hill Cipher - Encryption  Encrypting with the Hill cipher is built on the following operation: C = (K*P) mod 26  Where K is our key matrix and P is the plaintext in vector form.  Matrix multiplying these two terms produces the encrypted ciphertext. Example: Key= HILL Plaintext=exam Key Matrix= Plain Text =
  • 73. Hill Cipher – Encryption-Example -2  Encrypting with the Hill cipher is built on the following operation: C = (K*P) mod 26  Where K is our key matrix and P is the plaintext in vector form.  Matrix multiplying these two terms produces the encrypted ciphertext. Example: Key= HILL Plaintext=short example Key Matrix= Plain Text: =
  • 74. Hill Cipher – Encryption-Example -2 ciphertext = "APADJ TFTWLFJ". How to find 275 mod 26? =275/26 =10.5769 10.5769-10 0.5769x26=15
  • 75. Hill Cipher – Encryption-Example -2 ciphertext = "APADJ TFTWLFJ".
  • 76. Hill Cipher – Encryption-Example -3
  • 77. Hill Cipher – Encryption-Example -3
  • 78. Hill Cipher – Encryption-Example -3
  • 79. Hill Cipher – Encryption-Example -3 ciphertext = “FKMFIO".
  • 81. Hill Cipher - Encryption  Encrypting with the Hill cipher is built on the following operation: C = (K*P) mod 26  Where K is our key matrix and P is the plaintext in vector form.  Matrix multiplying these two terms produces the encrypted ciphertext. Example: Key= BKAAUBCPC Plaintext= retreat now Key Matrix= 𝑩 𝑨 𝑪 𝑲 𝑼 𝑷 𝑨 𝑩 𝑪 = 𝟏 𝟎 𝟐 𝟏𝟎 𝟐𝟎 𝟏𝟓 𝟎 𝟏 𝟐 Plain Text = 𝒓 𝒆 𝒕 𝒓 𝒆 𝒂 𝒕 𝒏 𝒐 𝒘 𝒙 𝒙 = 𝟏𝟕 𝟒 𝟏𝟗 𝟏𝟕 𝟒 𝟎 𝟏𝟗 𝟏𝟑 𝟏𝟒 𝟐𝟐 𝟐𝟑 𝟐𝟑
  • 82. Hill Cipher – Encryption C= P*K mod 26
  • 83. Hill Cipher – Encryption C= P*K mod 26
  • 84. Hill Cipher – Encryption C= P*K mod 26
  • 85. Hill Cipher – Encryption C= P*K mod 26 Ciphertext=DPQRQ EVKPQ LR
  • 86. Hill Cipher – Decryption
  • 87. Hill Cipher – Decryption Step 1: Calculate the multiplicative inverse for the determinant. Step 2: Multiply it with Adjoin matrix Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext
  • 88. Hill Cipher – Decryption: Example 2x2 Key matrix Step 1: Calculate the multiplicative inverse for the determinant. 1.1 Find Determinate of the Matrix Key Matrix = D=15
  • 89. Hill Cipher – Decryption: Example 2x2 Key matrix Step 2: Calculate the multiplicative inverse for the determinant. 1.2 Find multiplicative inverse of Determinate of the Matrix dd-1  1 mod 26 d * d-1 mod 26 =1 = 15 * d-1 mod 26 =1 (Hit and trial Method) If d-1 = 7 then 15*7 mod 26 = 105 mod 26=1 hence d-1 =7
  • 90. Hill Cipher – Decryption: Example 2x2 Key matrix Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.1 Calculate Adjoin matrix And for negative values, we have to add them with 26 to get the desired values between 0 and 25 for use in the decryption formula.
  • 91. Hill Cipher – Decryption: Example 2x2 Key matrix Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.2 Multiply d-1 with Adjoin matrix
  • 92. Hill Cipher – Decryption: Example 2x2 Key matrix Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘ELSC’
  • 93. Hill Cipher Decryption: Example 2 Key: HILL Ciphertext: APADJ TFTWLFJ Step 1: Calculate the multiplicative inverse for the determinant. Step 2: Multiply it with Adjoin matrix Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext
  • 94. Hill Cipher – Decryption: Example 2 Step 1: Calculate the multiplicative inverse for the determinant. 1.1 Find Determinate of the Matrix Key Matrix = D=15
  • 95. Hill Cipher – Decryption: Example :2 Step 2: Calculate the multiplicative inverse for the determinant. 1.2 Find multiplicative inverse of Determinate of the Matrix dd-1  1 mod 26 d * d-1 mod 26 =1 = 15 * d-1 mod 26 =1 (Hit and trial Method) If d-1 = 7 then 15*7 mod 26 = 105 mod 26=1 hence d-1 =7
  • 96. Hill Cipher – Decryption: Example :2 Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.1 Calculate Adjoin matrix And for negative values, we have to add them with 26 to get the desired values between 0 and 25 for use in the decryption formula.
  • 97. Hill Cipher – Decryption: Example :2 Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.2 Multiply d-1 with Adjoin matrix
  • 98. Hill Cipher – Decryption: Example :2 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘APADJ TFTWLFJ’
  • 99. Hill Cipher – Decryption: Example :2 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘APADJ TFTWLFJ’
  • 100. Hill Cipher – Decryption: Example :2 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘APADJ TFTWLFJ’
  • 101. Hill Cipher – Decryption: Example :2 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘APADJ TFTWLFJ’
  • 102. Hill Cipher – Decryption: Example:2 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘APADJ TFTWLFJ’
  • 103. Hill Cipher – Decryption: Example :2 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext as ‘APADJ TFTWLFJ’ Plain text: short example
  • 104. Hill Cipher Decryption: Example 3 Key: CDDG Ciphertext:FKMFIO Step 1: Calculate the multiplicative inverse for the determinant. Step 2: Multiply it with Adjoin matrix Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext
  • 105. Hill Cipher – Decryption: Example 3 Step 1: Calculate the multiplicative inverse for the determinant. 1.1 Find Determinate of the Matrix Key Matrix = D=3 𝐶 𝐷 𝐷 𝐺 = 2 3 3 6 2 3 3 6 = 2 ∗ 6 − 3 ∗ 3 = 3 𝑚𝑜𝑑 26 = 3
  • 106. Hill Cipher – Decryption: Example :3 Step 2: Calculate the multiplicative inverse for the determinant. 1.2 Find multiplicative inverse of Determinate of the Matrix dd-1  1 mod 26 d * d-1 mod 26 =1 = 3 * d-1 mod 26 =1 (Hit and trial Method) If d-1 = 9 then 3*9 mod 26 = 27 mod 26=1 hence d-1 =9
  • 107. Hill Cipher – Decryption: Example :2 Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.1 Calculate Adjoin matrix And for negative values, we have to add them with 26 to get the desired values between 0 and 25 for use in the decryption formula. 𝑎𝑑𝑗 2 3 3 6 = 6 −3 −3 2 = 6 −3 + 26 −3 + 26 2 = 6 23 23 2
  • 108. Hill Cipher – Decryption: Example :3 Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.2 Multiply d-1 with Adjoin matrix 9 × 6 23 23 2 𝑚𝑜𝑑 26 = 54 207 207 18 𝑚𝑜𝑑 26 = 2 25 25 18 If k = 2 3 3 6 , 𝑡ℎ𝑒𝑛 𝑘−1 = 2 25 25 18
  • 109. Hill Cipher – Decryption: Example :3 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext = ‘FKMFIO’ 2 25 25 18 𝐹 𝐾 = 2 25 25 18 5 10 mod 26 = 2 ∗ 5 + 25 ∗ 10 25 ∗ 5 + 18 ∗ 10 mod 26 = 260 305 𝑚𝑜𝑑 26 = 0 19 = 𝐴 𝑇
  • 110. Hill Cipher – Decryption: Example :3 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext = ‘FKMFIO’ 2 25 25 18 𝑀 𝐹 = 2 25 25 18 12 5 mod 26 = 2 ∗ 12 + 25 ∗ 5 25 ∗ 12 + 18 ∗ 5 mod 26 = 149 390 𝑚𝑜𝑑 26 = 19 0 = 𝑇 𝐴
  • 111. Hill Cipher – Decryption: Example :3 Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext = ‘FKMFIO’ 2 25 25 18 𝐼 𝑂 = 2 25 25 18 8 14 mod 26 = 2 ∗ 8 + 25 ∗ 14 25 ∗ 8 + 18 ∗ 14 mod 26 = 366 452 𝑚𝑜𝑑 26 = 2 10 = 𝐶 𝐾
  • 113. Hill Cipher Decryption Key: AHELATPBA Ciphertext: SYICHOLER Step 1: Calculate the multiplicative inverse for the determinant. Step 2: Multiply it with Adjoin matrix Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext
  • 114. Hill Cipher – Decryption: Example Step 1: Calculate the multiplicative inverse for the determinant. 1.1 Find Determinate of the Matrix 𝐶 𝐷 𝐷 𝐺 = 2 3 3 6
  • 115. Hill Cipher – Decryption: Example Step 1: Calculate the multiplicative inverse for the determinant. 1.1 Find Determinate of the Matrix D=11
  • 116. Hill Cipher – Decryption: Example Step 2: Calculate the multiplicative inverse for the determinant. 1.2 Find multiplicative inverse of Determinate of the Matrix dd-1  1 mod 26 d * d-1 mod 26 =1 = 11 * d-1 mod 26 =1 (Hit and trial Method) If d-1 = 19 then 11*19 mod 26 = 209 mod 26=1 hence d-1 =19
  • 117. Hill Cipher – Decryption: Example Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.1 Calculate Adjoin matrix (Method 1)
  • 118. Hill Cipher – Decryption: Example Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.1 Calculate Adjoin matrix (Method 2) First calculate cofactor matrix Then transpose the cofactor matrix
  • 119. Hill Cipher – Decryption: Example Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.1 Calculate Adjoin matrix (Using Method 1) And for negative values, we have to add them with 26 to get the desired values between 0 and 25 for use in the decryption formula.
  • 120. Hill Cipher – Decryption: Example Step 2: Multiply multiplicative inverse of the determinant with adjoin matrix 2.2 Multiply d-1 with Adjoin matrix
  • 121. Hill Cipher – Decryption: Example Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext = ‘SYICHOLER’
  • 122. Hill Cipher – Decryption: Example Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext = ‘SYICHOLER’
  • 123. Hill Cipher – Decryption: Example Step 3: Multiple inverse key matrix with Cipher text matrix to obtain plaintext ciphertext = ‘SYICHOLER’ Plaintext=we are safe
  • 124. Cryptanalysis of Hill Cipher • As with Playfair, the strength of the Hill cipher is that it completely hides single-letter frequencies. Indeed, with Hill, the use of a larger matrix hides more frequency information. • Thus, a 3*3 Hill cipher hides not only single-letter but also two-letter frequency information • The Hill Cipher's weaknesses to the known- plaintext attack is considered as its most important security imperfection since it can be cracked by taking n distinct pairs of plaintext and corresponding cipher-text
  • 125. GTU Question • Encrypt the message "meet me at the usual place " using the Hill cipher with the key 9 4 5 7 [winter 2018] [7 Marks] • Given key K= 17 17 5 21 18 21 2 2 19 and plaintext =”ney”. Find out the ciphertext applying Hill Cipher. [ 7 Marks] [Summer 2019] • Encrypt the message “GTU Examination” using the Hill cipher algorithm with the key matrix 5 17 4 15 . Show your calculations and the result. [Winter 2019] [7 marks]
  • 126.
  • 127.
  • 128.
  • 129.
  • 130.
  • 131.
  • 132. Polyalphabetic Cipher If two letters are the same in the ciphertext it does not mean they must decipher to the same plaintext letter.
  • 133. Polyalphabetic Cipher –Vigenere Cipher One of the simplest, polyalphabetic ciphers is the Vigenère cipher Method-1  It uses Vigenere’ table of size 26 x26  Each row one shift is made towards right in Cyclic Manner
  • 135. Polyalphabetic Cipher –Vigenere Cipher Ciphertext=R
  • 136. Polyalphabetic Cipher –Vigenere Cipher Ciphertext=RW Ciphertext=RWXOXCPOJ
  • 137. Polyalphabetic Cipher –Vigenere Cipher Ciphertext=RW Ciphertext=RWXOXCPOJ
  • 138. Polyalphabetic Cipher –Vigenere Cipher Decryption is performed by going to the row in the table corresponding to the key, finding the position of the ciphertext letter in this row, and then using the column’s label as the plaintext.
  • 142. Polyalphabetic Cipher –Vigenere Cipher Method-2  When the vigenere table is not given, the encryption and decryption are done by Vigenar algebraically formula in this method (convert the letters (A-Z) into the numbers (0-25)).  It generate Keystream from KEY by repeatedly writing key until length of keystream and Plaintext/Ciphertext are equal  Encryption Ci = (Pi + Ki) mod 26  Decryption Pi = (Ci - Ki) mod 26
  • 144. Polyalphabetic Cipher –Vigenere Cipher Method-2  Encryption Ci = (Pi + Ki) mod 26 PLAINTEXT G I V E M O N E Y 06 08 21 04 12 14 13 04 24 KEY L O C K L O C K L 11 14 2 10 11 14 2 10 11 CIPHERTEXT
  • 145. Polyalphabetic Cipher –Vigenere Cipher Method-2  Encryption Ci = ( Pi+ Ki) mod 26 PLAINTEXT G I V E M O N E Y 06 08 21 04 12 14 13 04 24 KEY L O C K L O C K L 11 14 2 10 11 14 2 10 11 CIPHERTEXT R W X O X C P O J
  • 146. Polyalphabetic Cipher –Vigenere Cipher Method-2  Decryption Pi = (Ci - Ki) mod 26 Ciphertext R W X O X C P O J 17 22 23 14 23 02 15 14 09 KEY L O C K L O C K L 11 14 2 10 11 14 2 10 11 Plaintext G I V E M O N E Y
  • 147. Cryptanalysis of Vigenere Cipher  The Vigenere Cipher initially seems very secure, however it can be broken fairly easily once the length of the keyword is known.  If we know that the length of the keyword is n, we can break the ciphertext into n cosets and attack the cipher using frequency analysis if the ciphertext sample is long enough. Kasiski tests to determine length of key
  • 148. Cryptanalysis of Vigenere Cipher Kasiski tests to determine length of key Example:  The second group of repeated letters IVE occurs 12 letters after the first.  The third group of letters appears 6 letters after the first.  GCD(6,12) is 6, this suggests that the length of the keyword is 6. Plaintext T H E C H I L D I S F A T H E R O F T H E M A N Keyword P O E T R Y P O E T R Y P O E T R Y P O E T R Y Ciphertext I V E V Y G A R M L M Y I V E K F D I V E F R L
  • 149. Cryptanalysis of Vigenere Cipher  The periodic nature of the keyword can be eliminated by using a nonrepeating keyword that is as long as the message itself.  Vigenère proposed what is referred to as an autokey system, in which a keyword is concatenated with the plaintext itself to provide a running key.  For our example,  Even this scheme is vulnerable to cryptanalysis.  Because the key and the plaintext share the same frequency distribution of letters, a statistical technique can be applied. key: deceptivewearediscoveredsav plaintext: wearediscoveredsaveyourself ciphertext: ZICVTWQNGKZEIIGASXSTSLVVWLA
  • 150. Vernam Cipher  The Vernam cipher was created by Gilbert Vernam  Keyword is long as the plaintext (has no statistical relationship with plaintext)  The essence of this technique is the means of construction of the key.  Vernam proposed the use of a running loop of tape that eventually repeated the key, so that in fact the system worked with a very long but repeating keyword.  Each character of the plaintext and the key is converted to binary using a character coding system like ASCII.  The plaintext binary is then XOR'd with the key binary to produce a new binary value.  This is then converted to a character and is part of the ciphertext.  The same technique is applied in reverse to decrypt information.
  • 155. Vernam Cipher  Although such a scheme, with a long key, presents formidable cryptanalytic difficulties, it can be broken with sufficient ciphertext, the use of known or probable plaintext sequences, or both.  Solution: One- Time Pad
  • 156. One Time Pad  An Army Signal Corp officer, Joseph Mauborgne, proposed an improvement to the Vernam cipher that yields the ultimate in security.  Mauborgne suggested using a random key that is as long as the message, so that the key need not be repeated.  In addition, the key is to be used to encrypt and decrypt a single message, and then is discarded,  Each new message requires a new key of the same length as the new message. Such a scheme, known as a one-time pad, is unbreakable.  It produces random output that bears no statistical relationship to the plaintext.
  • 159. One Time Pad The one-time pad is the only cryptosystem that exhibits what is referred to as perfect secrecy.
  • 163. Rail Fence Transposition - Decryption Ciphertext: MEMATEAKETETHPR Create a table Number of column = number of letter in Ciphertext Number of row = depth Put X in Zig Zag fashion X X X X X X X X X X X X X X X
  • 164. Rail Fence Transposition - Decryption Ciphertext: MEMATEAKETETHPR Now, write down Ciphertext, row by row where X is written Then, write down letter in Zig-Zag fashion Plaintext: MEETMEATTHEPARK M E M A T E A K E T E T H P R
  • 165. Rail Fence Transposition - Example Ciphertext: HORELOLLWD Plaintext: THIS IS A QUICK WAY TO MIX Depth: 3 Ciphertext: TIUWOHSSQIKATMXIACYI Plaintext: Hello World Depth: 3
  • 166. Rail Fence Transposition Attacker can try for different depth and find the plain text
  • 167. Row/Column Transposition  Plaintext is written in tabular form row by row where length of row determined by length of key.  Ciphertext is read out column by column where order of column is specified by Key.  Key = permutation of order of Column Example: Key=ZEBRAS (the key is 6 letters long hence there are 6 column in Plaintext table)
  • 171. Row/Column Transposition-Encryption In this example, the key is 4312567. To encrypt, start with the column that is labeled 1, in this case column 3. Write down all the letters in that column. Proceed to column 4, which is labeled 2, then column 2, then column 1, then columns 5, 6, and 7
  • 172. Cryptanalysis of Row/Column Transposition  For columnar/Row transposition, cryptanalysis is fairly straightforward and involves laying out the ciphertext in a matrix and playing around with column positions.  Digram and trigram frequency tables can be useful. Solution: Multiple transposition
  • 173. Double Row/Column Transposition  The transposition cipher can be made significantly more secure by performing more than one stage of transposition.  The result is a more complex permutation that is not easily reconstructed. 1st level transposition 2nd level transposition
  • 174. Double Row/Column Transposition  To visualize the result of this double transposition, designate the letters in the original plaintext message by the numbers designating their position.  Thus, with 28 letters in the message, the original sequence of letters is.  After the first transposition, we have  which has a somewhat regular structure. But after the second transposition, we have  This is a much less structured permutation and is much more difficult to cryptanalyze.