written 6.1 years ago by |
There are two basic building blocks of all encryption techniques.
Substitution
A substitution technique is one where letters of plain text are replaced by other letters / numbers / symbols. If the symbols in plaintext are alphabetic characters, we replace one character with another. for eg, We can replace letter A with letter D and letter T with letter R.If the symbols in plaintext are digits(0 to 9),we replace 3 with 2 ,7 with 8. Substitution Ciphers are categorized as either Monoalphabetic or Polyalphabetic.
- Monoalphabetic: A character in plaintext is always changed to the same character in the ciphertext regardless of its position in text. for eg, if the algorithm says, letter A in plaintext is replaced with D, every letter A is replaced to D. In other words, the relationship between the letters in plaintext and ciphertext is one -to- one.
For example,
Plaintext: HELLO
Ciphertext: KHOOR
Ciphertext is monoalphabetic because both L's are replaced by O's.
- Polyalphabetic: Each occurrence of character may have a different substitute.The relationship between the letters in plaintext and ciphertext is one -to- many. For example, "A" can be enciphered as " C" in the beginning of the text, but "P" at the middle of the text.
Example,
Plaintext: HELLO
Ciphertext: KHOQR
The ciphertext is polyalphabetic because both L's are replaced by different letters.
Transposition
A transposition cipher reorders symbols. It does not substitute one symbol for another, instead, it changes the location of the symbols/letters. A symbol in the first position of the plaintext may appear in the tenth position of the ciphertext. A symbol in the seventh position of the plaintext may appear in the first position of the ciphertext. Transposition ciphers are categorized as keyless ciphers and keyed ciphers.
Keyless: Permutation of characters takes place without the use of any key.
Keyed: Permutation of characters takes place with the use of a key.