There are two primary ways in which a plain text can be modified to obtain cipher text: Substitution Technique and Transposition Technique.
1. Substitution Technique:
Substitution technique involves the replacement of the letters by other letters and symbols. In a more straightforward way, the characters of plaintext are replaced, and other substitute characters, numbers and symbols are used at their place.
Types of Substitution Technique:
- Caesar Cipher –
In this all characters of plain text is replaced by other characters with same pattern. For example, a replaced with D, B replaced with E.
- Mono Alphabetic Cipher –
Major disadvantage of caesar cipher is that all elements are substituted with same technique, it make easy for cryptanalyst to crack it. In Mono Alphabetic Cipher, There is no relation between Substitution of characters. Therefore it makes harder for cryptanalyst to crack it. For example, a can be replaced with B-Z, B can be replaced with A, C-Z.
- Homophonic Substitution Cipher –
In this technique, one plain text alphabet can map to more than one cipher text alphabet. This is the best substitution technique with maximum security. For example, a can be replaced with D and E.
- Polygram Substitution Cipher –
In this rather than replacing one alphabet, block of alphabet is replaced. For example,
Polygram Subsitution HELLO -------------------> YUQQW HELL --------------------> TEUI
- Vigenere Cipher –
This technique uses multiple character keys .Each of the keys encrypts one single character. Each character is replaced by a number (A=0, B=1, …Z=25). After all keys are used, they are recycled. For encryption, Formula used : E=(M+K)mod 26
Plaintext: ATTACKATDAWN Key: LEMONLEMONLE Ciphertext: LXFOPVEFRNHR
2. Transposition Technique:
In transposition technique, the identity of the characters remains unchanged, but their positions are changed to create the ciphertext.
Types of Transpositional Techniques:
- Rail Fence Technique – It uses a simple algorithm:
- Write down plain text message as sequence of diagonals.
- Read the plain text written in step 1 as sequence of rows.
Plain text: come home c m h m o e o e Cipher text : (READ ROW BY ROW) cmhmoeoe
- Simple Columnar Transposition Technique – It uses a simple algorithm:
- Write the plain text message row by row in predefined columns.
- Read the message column by column. It can be in any order.
- Message thus obtained is cipher text message.
Plain text: come niki (suppose we have 4 columns ) C1 C2 C3 C4 c o m e n i k i
Now we can read in any order of columns. Lets read it by 3 -> 2 -> 4 ->1
Cipher text : mkoieicn
- Vernam Cipher – It uses a simple algorithm:
- Treat each plain text character as a number in increasing sequence (A=0, B=1, …Z=25).
- Do the same for each character of key.
- Add each number corresponding to plain text alphabet and key.
- If sum produced greater than 26, subtract 26 form it.
- Translate each number of sum back to alphabet, it gives our cipher text.
Plain text: HOW ARE YOU Key : NCBTZQARX H O W A R E Y O U 7 14 22 0 17 4 24 14 20 + N C B T Z Q A R X 13 2 1 19 25 16 0 17 23 ------------------------------------ 20 16 23 19 42 20 24 31 43 Subtract 26 if >26: 20 16 23 19 16 20 24 5 17 Cipher text : U Q X T R U Y F R Cipher text : UQXTRUYFR
Weakness of each technique,
In the case of Substitution:
- Because it’s based on the substitution of one letter with another based on a translation table. Once the translation table is known, the code is broken.
- Short words, words with repeated patterns, and common initial and final letters all give clues for guessing the pattern of the encryption.
- An encryption algorithm must be regular for it to be algorithmic and for cryptographers to be able to remember it. Unfortunately, the regularity gives clues to the cryptanalyst to break a substitution.
In the case of Transposition:
- Just as there are characteristic letter frequencies, there are also characteristic patterns of pairs of adjacent letters, called digrams (groups of 2 letter) and trigrams (groups of 3 letters). The frequency of appearance of letter groups can be used to match up plaintext letters that have been separated in a ciphertext.
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
- Difference between Block Cipher and Stream Cipher
- Difference between Substitution Cipher Technique and Transposition Cipher Technique
- Difference between Block Cipher and Transposition Cipher
- Difference between Monoalphabetic Cipher and Polyalphabetic Cipher
- Caesar Cipher in Cryptography
- Vigenère Cipher
- Hill Cipher
- Block Cipher modes of Operation
- Vernam Cipher in Cryptography
- Bifid Cipher in Cryptography
- Substitution Cipher
- Autokey Cipher | Symmetric Ciphers
- Internet Control Message Protocol (ICMP)
- Message Authentication Codes
- How message authentication code works?
- Message switching techniques
- Difference between Circuit switching and Message switching
- Message Digest in Information security
- Differences between Dynamic Binding and Message Passing in Java
- What is HMAC(Hash based Message Authentication Code)?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.