Classical encryption techniques have been used for centuries to protect information by transforming plaintext into a coded format. Two primary categories of classical encryption techniques are substitution ciphers and transposition ciphers.
Substitution Ciphers
Substitution ciphers involve replacing each element of the plaintext with another element. The most common types include:
- Caesar Cipher:
- A type of substitution cipher where each letter in the plaintext is shifted a fixed number of places down or up the alphabet.
- For example, with a shift of 3, ‘A’ becomes ‘D’, ‘B’ becomes ‘E’, and so on.
- Encryption:
- Decryption:
- Example:
- Plaintext: HELLO
- Ciphertext with shift of 3: KHOOR
- Monoalphabetic Cipher:
- Each letter of the plaintext is mapped to a unique letter of the ciphertext alphabet.
- Unlike the Caesar cipher, the mapping is more complex and not simply a uniform shift.
- Example:
- Plaintext: HELLO
- Ciphertext: IEBBN (where H->I, E->E, L->B, O->N)
- Polyalphabetic Cipher (e.g., Vigenère Cipher):
- Uses multiple substitution alphabets to encrypt the plaintext.
- A keyword is used to determine which alphabet to use for each letter of the plaintext.
- Example:
- Plaintext: HELLO
- Keyword: KEY
- Repeat the keyword to match the length of the plaintext: KEYKE
- Encrypt each letter using the corresponding letter of the keyword (A=0, B=1, etc.):
- H + K (7 + 10) = R (17)
- E + E (4 + 4) = I (8)
- L + Y (11 + 24) = J (9)
- L + K (11 + 10) = V (21)
- O + E (14 + 4) = S (18)
- Ciphertext: RIJVS
Transposition Ciphers
Transposition ciphers involve rearranging the positions of characters in the plaintext according to a certain system, without altering the actual characters themselves. Common types include:
- Rail Fence Cipher:
- The plaintext is written in a zigzag pattern across multiple “rails” and then read off in a row-wise manner.
- Example:
- Plaintext: WE ARE DISCOVERED FLEE AT ONCE
- Write in a zigzag pattern:
mathematica
W . . . R . . . I . . . E . . . E . . . C
. E . A . E . D . S . O . E . E . F . E . T . N . E .. . A . . . R . . . C . . . V . . . R . . . D . . . O .Read row-wise: WECRL EVDSO EERFE ATEEA NCD
- Columnar Transposition:
- The plaintext is written into a grid of fixed width and then read off column by column, based on a key that determines the column order.
- Example:
- Plaintext: WE ARE DISCOVERED FLEE AT ONCE
- Key: 3 1 4 2 5
- Write into a grid based on the key:
mathematica
3 1 4 2 5
W E A R ED I S C O V E R E DF L E E A T O N C E - Read columns in the order of the key: EVLN ACDT REESE OEAER DEOFR
Classical encryption techniques, such as substitution and transposition ciphers, form the foundation of modern cryptography. While they are no longer considered secure against today’s advanced cryptographic analysis, understanding these techniques provides valuable insights into the evolution of encryption methods.