Let us compare symmetric-key and asymmetric-key cryptography. Encryption can be thought of as electronic locking; decryption as electronic unlocking. The sender puts the message in a box and locks the box by using a key; the receiver unlocks the box with a key and takes out the message.
The difference lies in the mechanism of the locking and unlocking and the type of keys used. In symmetric-key cryptography, the same key locks and unlocks the box. In asymmetric-key cryptography, one key locks the box, but another key is needed to unlock it.
Traditional Cipher used in Symmetric-key Cryptography:
- Substitution cipher
- Transposition cipher
1. Substitution cipher
A substitution cipher substitutes one symbol with another. If the symbols in the plain- text are alphabetic characters, we replace one character with another. For example, we can replace character A with D, and character T with Z. If the symbols are digits (0 to 9), we can replace 3 with 7, and 2 with 6. It is also known and Ceaser's Cipher who invented it.
For example, if we encode the word “SECRET” using Caesar’s key value of 3, we offset the alphabet so that the 3rd letter down (D) begins the alphabet. So starting with ABCDEFGHIJKLMNOPQRSTUVWXYZ and sliding everything up by 3, you get DEFGHIJKLMNOPQRSTUVWXYZABC where D=A, E=B, F=C, and so on. Using this scheme, the plaintext, “SECRET” encrypts as “VHFUHW.” To allow someone else to read the cipher text, you tell them that the key is 3.
2. Transposition Ciphers
In a transposition cipher, there is no substitution of characters; instead, their locations change. A character in the first position of the plaintext may appear in the tenth position of the cipher text. A character in the eighth position may appear in the first position. In other words, a transposition cipher reorders the symbols in a block of symbols.
Key: In a transposition cipher, the key is a mapping between the position of the symbols in the plaintext and cipher text. For example, the following shows the key using a block of four characters:
Plaintext: 2 4 1 3
Cipher text: 1 2 3 4
In encryption, we move the character at position 2 to position 1, the character at position 4 to position 2, and so on. In decryption, we do the reverse.
3. Encryption algorithm
The most commonly used symmetric encryption are block ciphers. A block cipher processes the plain text input in fixed-size blocks and produces a block of cipher text of equal size for each plain text block.
The two most important symmetric algorithms, both of which are block ciphers, are