Encrypting and Decrypting With The Transposition Cipher
Encrypting and Decrypting With The Transposition Cipher
2
Transposition Ciphers
Example
A simple example for a transposition cipher is columnar transposition cipher where
each character in the plain text is written horizontally with specified alphabet
width. The cipher is written vertically, which creates an entirely different cipher
text.
3
Transposition Ciphers
The plain text characters are placed horizontally and the cipher text is created with
vertical format as : Hello World. Now, the receiver has to use the same table to
decrypt the cipher text to plain text.
4
Transposition Ciphers
Code
The following program code demonstrates the basic implementation of columnar
transposition technique −
Explanation
For the message
"wearediscoveredfleeatonce" and a key of
5, the grid would look like this:
5
Transposition Ciphers
Output
The program code for the basic implementation of columnar transposition technique
gives the following output −
Note − Cryptanalysts observed a significant improvement in crypto security when transposition technique is
performed. They also noted that re-encrypting the cipher text using same transposition cipher creates better
security. 6
Transposition Ciphers
K I L L C O R KEY
O N A V I R U Cipher Text (input)
S A T T W E L
V E A M T O M
O R R O W
CipherText:
LATARLVTMOINAERKOSVOCIWTWOREORULM 7
Transposition Ciphers
L A T A R L V KEY
T M O I N A E Cipher Text (input)
R K O S V O C
I W T W O R E
O Y R U L M Z
CipherText:
TOOTRAISWUAMKWYLTRIORNVOLLAORMVECEZ 8
Transposition Ciphers
9
Decryption of Transposition Ciphers
Code
Observe the following code
for a better understanding of
decrypting a transposition
cipher. The cipher text for
message Transposition
Cipher with key as 6 is
fetched as Toners
raiCntisippoh.
10
Decryption of Transposition Ciphers
Explanation
this code decrypts a transposition cipher by organizing the encrypted message into a grid based on the key,
filling it column by column, and then reconstructing the original message from that grid. The final output
displays the decrypted plaintext..
11
Decryption of Transposition Ciphers
Simulation
Key
1 T o n e
2 r s _ r
3 a i C
4 n t i
5 s i p
6 p o h
The decrypted cipher text with key 6 for message
12
Toners raiCntisippoh is Transposition Cipher.
Decryption of Transposition Ciphers
Output
The program code for decrypting transposition cipher gives the following output −
13
END OF LESSON
THANK YOU!
14