In classical cryptography, substitution and transposition ciphers are two fundamental techniques used to encrypt plaintext and conceal its original meaning.
1.) Substitution Cipher:
A substitution cipher is a method of encryption in which each character or group of characters in the plaintext is replaced by another character or group of characters according to a fixed system or key.
- The positions of the characters remain the same, but the actual letters or symbols are changed.
Example: In a Caesar cipher (a type of substitution cipher), each letter in the plaintext is shifted by a fixed number of positions in the alphabet.
For instance, with a shift of 3:
Plaintext: HELLO → Ciphertext: KHOOR
Types of Substitution Cipher:
- Monoalphabetic substitution: Each letter of the plaintext is replaced by a unique letter.
- Polyalphabetic substitution: Multiple cipher alphabets are used to encrypt the message (e.g., Vigenère cipher).
2.) Transposition Cipher:
A transposition cipher is a method of encryption where the positions of the characters in the plaintext are changed, but the characters themselves are not altered.
- The message is scrambled according to a defined pattern or key, such as a matrix or rail fence.
Example: Using the Rail Fence Cipher with 3 rails:
Plaintext: HELLO WORLD
- Rearranged as:
- Rail 1: H . . L . . W . . R
- Rail 2: . E . L . O . L . D
- Rail 3: . . L . . . O . .
Ciphertext: HLWR ELOLD LOO
Difference Between Substitution and Transposition Ciphers:

