0% found this document useful (0 votes)
29 views14 pages

Encrypting and Decrypting With The Transposition Cipher

Uploaded by

Suyen Carillo
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)
29 views14 pages

Encrypting and Decrypting With The Transposition Cipher

Uploaded by

Suyen Carillo
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/ 14

Encrypting and

Decrypting with the


Transposition Cipher
Lecture 4
Transposition Ciphers

Transposition Cipher is a cryptographic algorithm where the order of alphabets in


the plaintext is rearranged to form a cipher text. In this process, the actual plain
text alphabets are not included.

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

Consider the plain text hello world, and let us h e l l


apply the simple columnar transposition technique
as shown. o w o r
l d

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

Plaintext: “KILL CORONA VIRUS AT TWELVE AM TOMORROW


4 3 1 2 5 6 7

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

Plaintext: “KILL CORONA VIRUS AT TWELVE AM TOMORROW


4 3 1 2 5 6 7

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

The following program code


demonstrates the basic
Decryption of the columnar
transposition technique

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

You might also like