0% found this document useful (0 votes)
63 views103 pages

Classical Encryption Techniques

Uploaded by

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

Classical Encryption Techniques

Uploaded by

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

What’s Cryptography?

Symmetric Cipher Model


Symmetric Cipher Model (Contd..)

• Alice:- C = Ek(P)

• Bob:- D = Dk(C) = Dk(Ek(P))


Kerckhoff’s Principle

• Published by Auguste Kerckhoff in 1883.

• Uses 2 key principles:- Algorithm Transparency, and Key


Secrecy
3 Independent Dimensions of Cryptographic Systems

• Types of Operations used for transformation of PT to CT

• Number of keys used

• How PT is processed
CRYPTANALYSIS
Cryptanalysis Techniques on Encrypted Data

1) Brute Force Attack (BFA)


2) Statistical Attack
3) Pattern Attack
4) Ciphertext Only Attack
5) Known Plaintext Attack
6) Chosen Plaintext Attack
7) Chosen Ciphertext Attack
BFA
Statistical Attack

CT:-
• The letter ‘e’ is the most frequently used English alphabet for plaintext.
• Hence, for the above CT, the attacker makes a best case guess that most
probably the ciphertext character ‘w’ maps to the plaintext character ‘e’.
Statistical Attack (Contd..)
Pattern Attack
Ciphertext Only Attack
Known Plaintext Attack
Chosen Plaintext Attack
Chosen Ciphertext Attack
HIERARCHY OF CLASSICAL CIPHERS
Classical Ciphers

Substitution Transposition

Monoalphabetic Polyalphabetic Rail Fence

Additive Columnar
Cipher Hill

Permutation
Multiplicative Vernam
Vigenere
Cipher
Route
Affine Cipher Playfair
Default Numerical Values

Character Numerical Equivalent Character Numerical Equivalent


a 0 n 13
b 1 o 14
c 2 p 15
d 3 q 16
e 4 r 17
f 5 s 18
g 6 t 19
h 7 u 20
i 8 v 21
j 9 w 22
k 10 x 23
l 11 y 24
m 12 z 25
ADDITIVE CIPHER
Additive
Cipher
• Also called as Shift cipher.
• Here the key, PT and CT are in Z26.
Example 1

Encrypt the message “manipal” using key = 13, and additive cipher in Z26. Assume
that the alphabets are case-insensitive and use the default numerical equivalents.

Solution:-
m a n i p a l

12 0 13 8 15 0 11

c = (p+k) mod 26 = (p+13) mod 26


Example 1 (Contd..)

25 13 0 21 2 13 24

z n a v c n y

• Therefore, the encrypted message is “znavcny”.


Example 2

Decrypt the message “znavcny” using key = 13, and additive cipher in Z26. Assume
that the alphabets are case-insensitive and use the default numerical equivalents.

Solution:-
z n a v c n y

25 13 0 21 2 13 24

d = (c-k) mod 26 = (c-13) mod 26


Example 2 (Contd..)

12 0 13 8 15 0 11

m a n i p a l

• Therefore, the decrypted message is “manipal”.


Example 3

Assume that Additive cipher is used with some special characters with their corresponding
numerical equivalents as displayed in the table below. Assume that the alphabets which are
used are case-insensitive and use the default numerical equivalents. Decrypt the ciphertext
“>d@$d>>h$d@w” using key = 23.
Special Characters Numerical Equivalents
? 26
> 27
< 28
@ 29
# 30
$ 31
! 32
Example 3 (Solution)

• > (27) → {d = (c-23) mod 33} → 4 (e)

• d (3) → {d = (c-23) mod 33} → 13 (n)

• @ (29) → {d = (c-23) mod 33} → 6 (g)

• $ (31) → {d = (c-23) mod 33} → 8 (i)

• d (3) → {d = (c-23) mod 33} → 13 (n)

• > (27) → {d = (c-23) mod 33} → 4 (e)

• > (27) → {d = (c-23) mod 33} → 4 (e)


Example 3 (Solution)

• h (7) → {d = (c-23) mod 33} → 17 (r)

• $ (31) → {d = (c-23) mod 33} → 8 (i)

• d (3) → {d = (c-23) mod 33} → 13 (n)

• @ (29) → {d = (c-23) mod 33} → 6 (g)

• w (22) → {d = (c-23) mod 33} → 32 (!)

• Therefore, the decrypted text is “engineering!”


• Pairs of alphabets or characters are encrypted
or decrypted.
Digrams on • Most commonly used digrams in plaintexts
are ‘th’, ‘he’, ‘in’, etc.
Additive • c = (p+k) mod 676, when only alphabets are
Ciphers used by ignoring the case.
• d = (c-k) mod 676, when only alphabets are
used by ignoring the case.
Additive Cipher with digram (Example 1)

Encrypt the message “software” using key = 500, and additive cipher
using digrams. Assume that the alphabets are case-insensitive and use
the default numerical equivalents.

Solution:-

so ft wa re

26*18+14 = 482 26*5+19 = 149 26*22+0 = 572 26*17+4 = 446


Additive Cipher with digram (Example 1) (Contd..)

c = (p+k) mod 676 = (p+500) mod 676

306 = 26*11+20 649 = 26*24+25 396 = 26*15+6 270 = 26*10+10

lu yz pg kk

• The ciphertext is “luyzpgkk”.


Additive Cipher with digram (Example 2)

Decrypt the message “luyzpgkk” using key = 500, and additive cipher
using digrams. Assume that the alphabets are case-insensitive and use
the default numerical equivalents.

Solution:-

lu yz pg kk

26*11+20 = 306 26*24+25 = 649 26*15+6 = 396 26*10+10 = 270


Additive Cipher with digram (Example 2) (Contd..)

p = (c-k) mod 676 = (c-500) mod 676

482 = 26*18+14 149 = 26*5+19 572 = 26*22+0 446 = 26*17+4

so ft wa re

• The decrypted text is “software”.


• c = (p+3) mod 26

• d = (c-3) mod 26

• Ciphertext corresponding to the plaintext


“udupi” is “xgxsl”
Caesar
• Plaintext corresponding to the ciphertext
Cipher “pdqlsdo” is “manipal”.

• However, Caesar cipher is generalized as


additive cipher to use key of any value.
• Simple to understand, and Easy to implement.
• Demands negligible computational resources.

Pros and • Highly vulnerable to BFA.


Cons of • Vulnerable to Statistical attack.
Additive
Cipher
HILL CIPHER
• Developed by Lester Hill in 1929.
• Uses concepts of Linear Algebra.
Hill • C = P * K (mod 26), where P is of order m*n,
and K is of order n*n.
Cipher -1
• D = C * K (mod 26)
• Note:- K is an invertible matrix, and
GCD(det(K), 26) = 1
Example 1
• Encrypt the plaintext “engineer” using Hill Cipher with the key matrix displayed below.
Assume that only alphabets are used for encryption/decryption, by ignoring the case.
5 6
K=
3 9

Solution:-
e n 4 13
g i 6 8
• P= =
n e 13 4
e r 4 17

• C = P*K (mod 26)


Example 1 (Contd..)
4 13 59 141
6 8 5 6 54 108
• C= * (mod 26) = (mod 26)
13 4 3 9 77 114
4 17 71 177

7 11 𝐡 𝐥
2 4 𝐜 𝐞
• C= =
25 10 𝐳 𝐤
19 21 𝐭 𝐯

• Therefore, the ciphertext is “hlcezktv”.


Example 2
• Decrypt the ciphertext “hlcezktv” using Hill Cipher with the key matrix
displayed below. Assume that only alphabets are used for
encryption/decryption, by ignoring the case.
5 6
K=
3 9

Solution:-
• det(K) = 27

h l 7 11
c e 2 4
• C= =
z k 25 10
t v 19 21
Example 2 (Contd..)
-1 9 −6 -1
• K = * 27 (mod 26)
−3 5
q a b r u1 u2 u
1 27 26 1 1 0 1
26 26 1 0 0 1 -26
1 0 1 -26

9 −6 9 20
• K-1 = * 1 (mod 26) =
−3 5 23 5
Example 2 (Contd..)
7 11
2 4 9 20
• D = C*K-1 (mod 26) = * (mod 26)
25 10 23 5
19 21

316 195 4 13 𝐞 𝐧
110 60 6 8 𝐠 𝐢
• D= (mod 26) = =
455 550 13 4 𝐧 𝐞
654 485 4 17 𝐞 𝐫

• Therefore, the decrypted text is “engineer”.


Example 3
• Decrypt the ciphertext “rrlmwbkaspdh” using Hill Cipher with the key matrix
displayed below. Assume that only alphabets are used for encryption/decryption,
by ignoring the case.
17 17 5
K = 21 18 21
2 2 19

Solution:-
𝑟 𝑟 𝑙 17 17 11
𝑚 𝑤 𝑏 12 22 1
C= =
𝑘 𝑎 𝑠 10 0 18
𝑝 𝑑 ℎ 15 3 7
Example 3 (Contd..)
300 −313 267
• K-1 = −357 313 −252 * (-939)-1 (mod 26)
6 0 −51

−300 313 −267


-1 -1
• K = 357 −313 252 * (939) (mod 26)
−6 0 51

−300 313 −267 4 9 15


-1
• K = 357 −313 252 * 9 (mod 26) = 15 17 6
−6 0 51 24 0 17
Example 3 (Contd..)
17 17 11
4 9 15
-1 12 22 1
• D = C * K (mod 26) = * 15 17 6 (mod 26)
10 0 18
24 0 17
15 3 7

587 442 544 15 0 24 𝑝 𝑎 𝑦


402 482 329 12 14 17 𝑚 𝑜 𝑟
• D= (mod 26) = = 𝑒 𝑚 𝑜
472 90 456 4 12 14
273 186 362 13 4 24 𝑛 𝑒 𝑦

• Therefore, the decrypted text is “paymoremoney”.


• Simple and Easy to understand and implement
with prior knowledge of linear algebra.
• More resistant to statistical attack than that for
any other monoalphabetic ciphers.
• Use of matrices adds an additional level of
Pros and security.

Cons of Hill • Limited key size and key space if 2*2 matrix is
Cipher used as the key.
• Poor efficiency for encrypting and decrypting
data using large key matrices.
VIGENERE CIPHER
• The length of the key is made equal to that
of the plaintext or ciphertext if its not the
case already.
• ci = (pi + ki mod m) mod 26
• pi = (ci – ki mod m) mod 26
Vigenere • Typically, m is lesser than the length of
Cipher plaintext or ciphertext.
Example 1
• Encrypt the plaintext “karnataka” using Vigenere Cipher and the key “hello”. Assume
that the encryption/decryption is done using only alphabets by ignoring the case.

Solution:-
k a r n a t a k a
PT (10) (0) (17) (13) (0) (19) (0) (10) (0)

+
Key h e l l o h e l l
(7) (4) (11) (11) (14) (7) (4) (11) (11)

(mod 26) =
Example 1 (Contd..)
CT 17 4 2 24 14 0 4 21 11
(r) (e) (c) (y) (o) (a) (e) (v) (l)

• Therefore, the ciphertext is “recyoaevl”.


Example 2
• Decrypt the ciphertext “recyoaevl” using Vigenere Cipher and the key “hello”.
Assume that the encryption/decryption is done using only alphabets by ignoring the
case.

Solution:- r e c y o a e v l
CT (17) (4) (2) (24) (14) (0) (4) (21) (11)

-
Key h e l l o h e l l
(7) (4) (11) (11) (14) (7) (4) (11) (11)

(mod 26) =
Example 2 (Contd..)
PT 10 0 17 13 0 19 0 10 0
(k) (a) (r) (n) (a) (t) (a) (k) (a)

• Therefore, the decrypted text is “karnataka”.


Example 3
• Decrypt the ciphertext “yitpiyxugubnmtf” using Vigenere Cipher and the key
“manipal”. Assume that the encryption/decryption is done using only alphabets by
ignoring the case.

Solution:- CT y i t p i y x u g u b n m t f
(24) (8) (19) (15) (8) (24) (23) (20) (6) (20) (1) (13) (12) (19) (5)

-
Key m a n i p a l m a n i p a l m
(12) (0) (13) (8) (15) (0) (11) (12) (0) (13) (8) (15) (0) (11) (12)

(mod 26) =
Example 3 (Contd..)
PT 12 8 6 7 19 24 12 8 6 7 19 24 12 8 19
(m) (i) (g) (h) (t) (y) (m) (i) (g) (h) (t) (y) (m) (i) (t)

• Therefore, the decrypted text is “mightymightymit”.


• Simple to understand and easy to implement.
• More resistant to statistical attack and pattern
attack when compared to that of
monoalphabetic ciphers.
• When the PT is long, the cipher is resistant to
Pros and BFA if the key is long enough.
Cons of
Vigenere • Vulnerable to BFA if PT is extremely short.
Cipher • Vulnerable to statistical attack if key length is
significantly lesser than that of the plaintext.
• Vulnerable to pattern attack if key length is
significantly lesser than that of the plaintext.
PLAYFAIR CIPHER
Playfair Cipher

• Invented by Charles Wheatstone in the year 1854.


• Encrypts or decrypts digrams.
• Key is a 5*5 matrix with all the alphabets (letters i and j are
considered as a single entry appropriately) arranged row-
wise.
Generation of key matrix from key

• Initially the alphabets of the key are arranged row-wise in a


5*5 matrix, by removing duplicates from the key.
• Rest of the vacancies of the matrix are filled with remaining
alphabets.
Generation of key matrix from key (Example 1)

• Consider that the key is “UDUPI”.


• The corresponding key matrix will be:-
U D P I A
B C E F G
H K L M N
O Q R S T
V W X Y Z
Generation of key matrix from key (Example 2)

• Consider that the key is “JAIPUR”.


• The corresponding key matrix will be:-
I A P U R
B C D E F
G H K L M
N O Q S T
V W X Y Z
Steps for Processing Plaintexts

• Plaintext is processed as each digram at a time.


• Plaintext is modified (if necessary) to make sure that no digram has a duplicate alphabet (by
replacing a duplicate alphabet by x).
• Plaintext is modified (if necessary) to make sure that no alphabet is left unpaired (by adding x
to the last alphabet of the original plaintext to make it form a digraph).
• FEVER ➔ FEVERX
• SHEEP ➔ SHEXEP
• TEAM ➔ TEAM
Steps for Encrypting a Plaintext

• If both the alphabets of a digram are in the same row, then each
alphabet is replaced by the alphabet immediately towards its right (the
alphabet in the last column is replaced by the alphabet in the first
column).
• If both the alphabets of a digram are in the same column, then each
alphabet is replaced by the alphabet immediately below it (the alphabet
in the last row is replaced by the alphabet in the first row).
• Else, in a digram each alphabet is replaced by the alphabet which is in
the same row but in the column of the other alphabet of the digraph.
Steps for Decrypting a Ciphertext

• If both the alphabets of a digram are in the same row, then each
alphabet is replaced by the alphabet immediately towards its left (the
alphabet in the first column is replaced by the alphabet in the last
column).
• If both the alphabets of a digram are in the same column, then each
alphabet is replaced by the alphabet immediately above it (the alphabet
in the first row is replaced by the alphabet in the last row).
• Else, in a digraph each alphabet is replaced by the alphabet which is in
the same row but in the column of the other alphabet of the digram.
Example 1
• Encrypt the plaintext “CHENNAI” using the key “MANGALORE”.
Solution:-
• Key matrix:-
M A N G L
O R E B C
D F H I K
P Q S T U
V W X Y Z

• Modified PT = CHENNAIX
Example 1 (Contd..)
• CH ➔ EK
• EN ➔ HE
• NA ➔ GN
• IX ➔ HY

• Therefore, the ciphertext is “EKHEGNHY”.


Example 2
• Decrypt the ciphertext “EKHEGNHY” using the key
“MANGALORE”.
Solution:-
• Key matrix:-
M A N G L
O R E B C
D F H I K
P Q S T U
V W X Y Z
• Modified CT = EKHEGNHY
Example 2 (Contd..)
• EK ➔ CH
• HE ➔ EN
• GN ➔ NA
• HY ➔ IX

• The decrypted text is “CHENNAIX”.


• Therefore, the final decrypted text is “CHENNAI”.
Example 3
• Encrypt the plaintext “HELLOINDIA” using the key “PLAYFAIR”.
Solution:-
• Key matrix:-
P L A Y F
I R B C D
E G H K M
N O Q S T
U V W X Z

• Modified PT = HELXLOINDIAX
Example 3 (Contd..)
• HE ➔ KG
• LX ➔ YV
• LO ➔ RV
• IN ➔ EU
• DI ➔ IR
• AX ➔ YW

• Therefore, the ciphertext is “KGYVRVEUIRYW”.


Example 4
• Decrypt the ciphertext “LGXNDODENPDSAU” using the key
“PRINCIPLESOFCRYPTOGRAPHY”.
Solution:-
• Key matrix:-
P R I N C
L E S O F
Y T G A H
B D K M Q
U V W X Z
• Modified CT = LGXNDODENPDSAU
Example 4 (Contd..)
• LG ➔ SY
• XN ➔ MX
• DO ➔ ME
• DE ➔ TR
• NP ➔ IC
• DS ➔ KE
• AU ➔ YX

• The decrypted text is “SYMXMETRICKEYX”.


• Therefore, the final decrypted text is “SYMMETRICKEY”.
• Simple to understand and easy to implement when the
plaintext length is even and when the original digrams
don’t have duplicate alphabets.
• BFA on the cipher is almost impossible.
• Resistant to statistical and pattern attacks when the
plaintexts are short.
Pros and • Key Management is easy.
Cons of
• Implementation gets complicated when the plaintext
Playfair length is odd, or the original digrams have duplicate
alphabets.
Cipher • Vulnerable to statistical and pattern attacks when the
plaintexts are long (> 1000 characters).
VERNAM CIPHER
Vernam Cipher

• Introduced by Gilbert Vernam in 1918.


• Length of the plaintext = Length of the
key.
• Vernam with One Time Pad (OTP)
provides more resistance to statistical
attack when compared to Vigenere
cipher.
Vernam with OTP

• Improved version of Vernam Cipher.


• Length of the key (random) = Length of the plaintext
• The key is discarded after every session.
• Produces a random ciphertext.
• Statistical attack becomes almost impossible.
Vernam with OTP (Examples)

• Encryption of “cryptography” using the key “zabbcgvikjyx” is


“brzqvubzkyfv” (using only alphabets by ignoring the case).
• Encryption of “cryptography” using the key “aghhqztuypfr” is
“cxfwjnzlyemp” (using only alphabets by ignoring the case).
• Encryption of “operatingsystems” using the key “xgpuukrxfepsrxal”
is “lvtludzklwnkkbmd” (using only alphabets by ignoring the case).
Disadvantages of using Vernam with OTP

• Generation of large random key for every session, when the plaintext is
huge.
• Key Management becomes harder.
• Most probably its used for only low bandwidth channels.
RAIL FENCE CIPHER
Rail Fence Cipher

• Encryption:- The plaintext characters are written as a sequence of


diagonals in a table based on the depth (Number of rows = depth)
in a zig-zag manner. The ciphertext is obtained by reading the
characters in the Rail Fence table, row-wise.

• Decryption:- Create a blank table with rows equal to the depth


and columns equal to the length of the ciphertext. Enter the first
ciphertext character in the top-left cell, then move diagonally
down to the last row and back up to the first row, placing the next
character in the corresponding column when you return to the top.
Continue this process, leaving blank spaces as needed until all
characters are placed. Fill any remaining blank spaces row-wise
with the remaining ciphertext characters. To decrypt, read the
ciphertext characters diagonally in a zig-zag pattern.
Example 1
• Encrypt the plaintext “KANNIYAKUMARI” using Rail fence cipher with
a depth of 2.

Solution:-

K N I A U A I
A N Y K M R
• The ciphertext is “KNIAUAIANYKMR”.
Example 2
• Decrypt the ciphertext “KNIAUAIANYKMR” using Rail fence cipher
with a depth of 2.

Solution:-

• Iteration 1:-
K N I A U A I
_ _ _ _ _ _
Example 2 (Contd..)
• Iteration 2:-
K N I A U A I
A N Y K M R

• Therefore, the decrypted text is “KANNIYAKUMARI”.


Example 3
• Encrypt the plaintext “COMPUTERNETWORKS” using Rail Fence cipher
with a depth of 3.

Solution:-

C U N O
O P T R E W R S
M E T K

• The ciphertext is “CUNOOPTREWRSMETK”.


Example 4
• Decrypt the ciphertext “CUNOOPTREWRSMETK” using Rail fence
cipher with a depth of 3.

Solution:-

• Iteration 1:-
C U N O
_ _ _ _ _ _ _ _
_ _ _ _
Example 4 (Contd..)
• Iteration 2:-
C U N O
O P T R E W R S
M E T K

• Therefore, the decrypted text is “COMPUTERNETWORKS”.


Example 5
• Decrypt the ciphertext “MLRAAUESNPNVIYIIT” using Rail fence
cipher with a depth of 4.

Solution:-

• Iteration 1:-

M L R
_ _ _ _ _
_ _ _ _ _ _
_ _ _
Example 5 (Contd..)
• Iteration 2:-
M L R
A A U E S
N P N V I Y
I I T

• The decrypted text is “MANIPALUNIVERSITY”.


• Simple to understand and easy to implement.
• Has got low computation cost.

• Vulnerable to Statistical attack.


Pros and • Vulnerable to Pattern attack.
• Vulnerable to BFA.
Cons of Rail
Fence Cipher
COLUMNAR CIPHER
Columnar Cipher

• Provides grid-based encryption and decryption.


• The plaintext is written row-wise, and the
ciphertext is generated by reading the plaintext
characters column-wise.
• The ciphertext is written column-wise in a certain
order, and the decrypted text is generated by
reading the ciphertext characters row-wise.
• The key contains a sequence of numbers
representing the order of columns.
• Multiple stages can be used to enhance the security.
Processing the key

• The key could either be represented as a sequence of


numbers or as a text.
• If the key is a text, then the text is converted into a
sequence of numbers according their alphabetical order
in the text.
• The length of the key = number of columns.
• Assume that the key is ‘4 2 1 3 5’. This indicates that
the grid consists of 5 columns.
• If the key is ‘hello’, then the corresponding sequence
of numbers for the key would be ‘2 1 3 4 5’.
Steps for Encryption

• Number of Rows = Ceil(Length(PT)/Number of


Columns)
• Fill the grid row-wise with plaintext characters (At the
end, fill any vacancy with ‘x’).
• Obtain the ciphertext, by reading the plaintext characters
column-wise according to sequence of numbers.
• For example, a key having a sequence ‘3 1 2’ indicates
that the grid has 3 columns. Moreover, during CT
calculation, the second column is read first, third column
is read second, and the first column is read third.
Steps for Decryption

• Number of Rows = Length(CT)/Number of Columns


• Fill the grid column-wise with the Ciphertext characters
according to sequence of numbers in the key.
• Obtain the decrypted text by reading the Ciphertext
characters row-wise.
• For example, if the key has a sequence ‘3 1 2’, then the
second column is filled first, third column is filled
second, and the first column is filled third.
Example 1
• Encrypt the plaintext “GOCORONAGO” using single stage columnar
transposition with key “HELLO”.

Solution:-
• “HELLO” → “2 1 3 4 5”

G O C O R
O N A G O

• Therefore, the Ciphertext is “ONGOCAOGRO”.


Example 2
• Decrypt the Ciphertext “ONGOCAOGRO” using single stage columnar
transposition with key “HELLO”.

Solution:-
• “HELLO” → “2 1 3 4 5”
• IT1:-

O
N
Example 2 (Contd..)
• IT2:-
G O
O N

• IT3:- G O C O R
O N A G O

• Therefore, the decrypted text is “GOCORONAGO”.


Example 3
• Encrypt the plaintext “GOCORONAGO” using double stage columnar
transposition with key “HELLO”.

Solution:-
• “HELLO” → “2 1 3 4 5”

G O C O R
O N A G O

• CT after first stage encryption:- “ONGOCAOGRO”.


Example 3 (Contd..)
• Now encrypt “ONGOCAOGRO”.
2 1 3 4 5
O N G O C
A O G R O

• Therefore, the final Ciphertext is “NOOAGGORCO”.


Example 4
• Decrypt the Ciphertext “NOOAGGORCO” using double stage columnar
transposition with key “HELLO”.

Solution:-
• “HELLO” → “2 1 3 4 5”

O N G O C
A O G R O
• Decrypted text after first stage decryption:- “ONGOCAOGRO”.
Example 4 (Contd..)
• Now decrypt “ONGOCAOGRO” again.
2 1 3 4 5
G O C O R
O N A G O

• Hence, the final decrypted text is “GOCORONAGO”.


Example 5
• Decrypt the Ciphertext
“CALONAIXACEIEIEMUMHXAHXADFXYRPODTNG” using double stage
columnar transposition with key “MANIPAL”.

Solution:-
• “MANIPAL” →

5 1 6 3 7 2 4
Example 5 (Contd..)
5 1 6 3 7 2 4

A C F E O A M
H A X I D I U
X L Y E T X M
A O R I N A H
D N P E G C X

• The decrypted text after first stage decryption:-


“ACFEOAMHAXIDIUXLYETXMAORINAHDNPEGCX”.
Example 5 (Contd..)
• Now decrypt “ACFEOAMHAXIDIUXLYETXMAORINAHDNPEGCX”
again.
5 1 6 3 7 2 4
M A N I P A L
A C A D E M Y
O F H I G H E
R E D U C A T
I O N X X X X
• The decrypted text after second stage decryption:-
“MANIPALACADEMYOFHIGHEREDUCATIONXXXX”.
• Hence, truncating the 4 ‘X’s at the end, the decrypted text is
“MANIPALACADEMYOFHIGHEREDUCATION”.
• Simple to understand and straight forward to implement.
• Resistant to BFA if key is slightly long or longer.
• More resistant to Statistical attack, when compared to Rail
Fence, if (length of PT) mod (length of the key) is close to 0,
but not equal to 0.
Pros and • Resistant to Pattern attack, when long keys are used, with
multiple stages.
Cons of
Columnar • Vulnerable to BFA if key is short.
• Highly vulnerable to Statistical attack, if length(PT) is a
Transposition multiple of that of the key.
• Highly vulnerable to Pattern attack, when a short key is
Cipher used, with a single stage transposition.
• Use of multiple stages will reduce the efficiency when long
PT is used.

You might also like