During this lab, we will implement the Caesar Cipher and Vigenere Cipher for Symmetric Cryptography.
Below is an example of symmetric encipherment using Caesar Cipher
The Caesar Cipher is formed by shifting the letters of the original alphabet. For example by replacing each letter of the alphabet with the letter three places down the alphabet. It is monoalphabetic as only one letter in plaintext is exchanged for one letter of ciphertext.
Plaintext alphabet A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Ciphertext key D E F G H I J KLM NO P Q RS T U V W X Y Z A B C
A caesar cipher with a key 3
For an example the plain text below can be encrypted using key 3 to get the cipher text
THE ATTACK TONIGHT START AT EIGHT, REGROUP AT STATION A
Plaintext
WKHDWWDFNWRQLJKWVWDUWDWHLJKWUHJURXSDWVWDWLRQD
Ciphertext
Example of symmetric cryptography using Vigenere Cipher
The cipher text encrypted using Caesar cipher method is easily broken by using a brute force attack. An attacker can easily try every combinations of character to break the code as the number of possibility is just 26. In order to improve the deciphering process we can used the vigeneré cipher method. The Vigenère cipher is a method of encrypting alphabetic text by using a series of different Caesar ciphers based on the letters of a keyword. It is a simple form of polyalphabetic substitution.
A key is needed to encrypt a plaintext; a key can be a word or a phrase. To have a strong cipher text it is advised to use different key on each encryption. This will prevent from a brute force attack on a second message if the first message has been intercepted.
Vigenere Cipher