Introduction to Cryptography: Vigenère Cipher [Part 2]

Written by gurdeep | Published 2020/12/06
Tech Story Tags: cryptography | passwords | authentication | mathematics | basics | security | cipher | hackernoon-top-story

TLDRvia the TL;DR App

Hi again and welcome back to part 2 of the basic cryptography. Previously we discuss about what is cryptography and how fundamental and ancient problem it is in communication science. We talk about ceaser's cipher and how easy it is to break. We also talk about Substitution Cipher which was slight improvement to Ceaser' cipher but can easily be cracked using Frequency analysis technique.
In this we talk about one of my favorite Cipher i.e Vigenère cipher. This one is named after a French mind Blaise de Vigenère after he published in 1586, however it was first proposed by Italian mind Giovan Battista Bellaso in 1553. This cipher was so good that it took 3 centuries to successfully find a method to crack. So lets check it out what it is .
The main problem at that time with code makers was Frequency analysis technique used by code breakers and Bellaso want to beat this technique . He come with this idea of polyalphabetic cipher . As in frequency analysis technique, it is assumed that one alphabet is mapped with only one so Bellaso want to design a method in which one alphabet can be mapped to multiple alphabets, which will make Frequency analysis not applicable. He come up with very neat solution.
suppose we work in English, What Bellaso purpose is as follow:
1. Create 2 dimension table for the alphabet in English as shown in image
which is not difficult to understand and make.
2. Now the person who want to encrypt the message has to follow these simple steps:
suppose , Bob want to encrypt message "this is my secret", then he chose a key like "mykey". Now to encrypt write message and key together as.
|t |h|i |s|i |s |m|y|s |e|c |r |e|t| ---> message to encrypt or plain text
|m|y|k|e|y|m|y |k|e|y|m|y|k|e| ---> key mapped to plain text

Basically he writes all letters of the message text and below he write the key's letters to the length of the message text by repeating the key again and again.
To finally encrypt what he will do now is, took the first letter of the message which is t and is paired with m of the key, so he look the m row and t column in the alphabet table. This will give him the letter f , so first t of the message will become f. similarly for second letter i.e h he will look y row and h column in table which give letter f , he will repeat same for all letters in message which give final output as :
|t |h|i |s|i |s |m|y|s |e|c |r |e|t| ---> message to encrypt or plain text
|m|y|k|e|y|m|y |k|e|y|m|y|k|e| ---> key mapped to plain text
|F |F|S|W|G|E|K|I|W|C|O|P|O|X| ---> encrypted message.
So the message "this is my secret" became "ffsw ge ki wcopox". It clearly can be seen that both ,first t and h of the plain text, encrypted to letter f . This is the main power of this cipher as frequency analysis will not work here as letter frequency is disguised.
3. To decrypt the message, he has to follow the following steps:
|F |F|S|W|G|E|K|I |W|C|O|P|O|X| ---> encrypted message
|m|y|k|e|y|m|y | k|e |y|m|y |k |e| ---> key

He will pick the first letter of the encrypted letter i.e F and corresponding key's letter i.e m . Now he go to the m'th row of the table and search F in the same row. The column in which he find F will give the first letter of plain message i.e t . Doing this for all he get the plain text as "thisismysecret"
So this is the Vignere cipher. It is very simple to understand and implement but very hard to crack. In-fact the first successful crack of this cipher was achieved after 300 years of its invention by Charles Babbage in 1854.
Up next I will write about how to crack Vigenère cipher . Till then you can try to crack it by own , here is my secret "QSH FGE AQF KFGE KV" :-0
Image Credit: https://en.wikipedia.org/wiki/Blaise_de_Vigen%C3%A8re

Written by gurdeep | tech enthusiast. love computers , programming and hacking.
Published by HackerNoon on 2020/12/06