Permutation Cipher / Transposition Cipher
A Permutation Cipher, also known as a Transposition Cipher, is a method of encryption where the letters of the plaintext (original message) are rearranged (shuffled) according to a fixed scheme. The identity of the individual letters remains unchanged.
- Substitution Cipher: Changes the value of the letters (e.g., A $\rightarrow$ D).
- Permutation Cipher: Changes the position of the letters (e.g., A B C $\rightarrow$ B C A).
1. How It Works: Matrix-Based Rearrangement
Transposition ciphers typically involve filling the plaintext into a matrix (or grid) and then reading the contents out in a pre-defined order (e.g., column by column or diagonally) to generate the ciphertext.
Example: Rail Fence Cipher
One of the simplest transposition ciphers, it rearranges letters in a zigzag pattern.
Plaintext: SECRET MESSAGE
Key: 3 (3 Rails)
- Writing in Zigzag (Encryption)
The letters are written diagonally across 3 rows.
S . . . E . . . M . . . E . . E . R . T . E . S . A . G . . . C . . . M . . . S . . . E -
Reading Row by Row (Ciphertext Generation) The rows are read sequentially from left to right.
- Row 1:
S E M E - Row 2:
E R T E S A G - Row 3:
C M S E
- Row 1:
-
Ciphertext:
SEMEERTESAGCMSE
2. Decryption
Decryption reverses the process.
- Calculate the size of the matrix using the ciphertext length and the key (number of rails).
- Create an empty matrix of that size and fill it row by row using the ciphertext letters.
- Read the matrix again using the original zigzag pattern to restore the plaintext.
3. Security Weakness
A weakness of transposition ciphers is that the frequency distribution of letters remains exactly the same as the plaintext language. This makes it possible to identify the language using frequency analysis, though determining the exact transposition key can be time-consuming. Modern cryptography combines both substitution and permutation for strong security.