Harshil-Soni17502 / Implementaton-of-Hill-cipher-and-Playfair-cipher-in-C-.

What are ciphers and what are their uses? Here details about the Playfair Cipher and Hill Cipher and their implementations in C++ are included in this repository.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ciphers

Cipher is a branch of cryptography that is used for encryption and decryption of the texts through an algorithm. Ciphers can be used for transmitting the private messages that are very imporatant in such a way that no one except the desired person can know what the message is. So cipher is a tool to hide the the actual messages so that if a layman reads that message than he/she won't be able to recognise the message. There are many type of ciphers available but here I had worked upon the imlementation of the two ciphers which are Playfair Cipher and Hill Cipher. Playfair Cipher was invented by Charles Wheatstone but was named after Lord Playfair who promoted the use of this cipher. Playfair cipher was used by British in Second Boer War and World War I and by Australians in World War II. In Playfair Cipher a key which is in form of word is to be chosen which is same for the sender and the receiver and then a 5x5 matrix is constructed on the basis of this key in which the first entries will be the alphabets of key chosen and then remaining alphabets from A-Z are filled in the matrix in order from left to right and top to bottom. Here I and J are in the same row and same column.Now using some set of rules the message is encrypted and decrypted.For more details of Playfair cipher you can the visit the website https://en.wikipedia.org/wiki/Playfair_cipher. Hill Cipher was invented by Lester S. Hill. It was the first cipher in which it was possible to operate on more than three symbols at a time. Here also a key is chosen which is in the form of a square matrix such that the it's inverse is possible and the key chosen should not have determinant value divisible by 2 and 13. Now the message is broken into smaller subgroups of size equal to dimension of key matrix and then these smaller subgroups are converted to column matrix with the help of some rules and multiplied with the key matrix and hence we get encrypted text and then we find the inverse of key matrix and again we break the encrypted text into subgroups of size equal to dimension of key matrix and then these subgroups are converted into column vector with the same set of rules and multiplied with the inverse of the key matrix to get the original text back.For more details of Hill Cipher you can visit the website https://en.wikipedia.org/wiki/Hill_cipher#:~:text=In%20classical%20cryptography%2C%20the%20Hill,than%20three%20symbols%20at%20once. Here the software implementation of Payfair Cipher and Hill Cipher in c++ are attached.

About

What are ciphers and what are their uses? Here details about the Playfair Cipher and Hill Cipher and their implementations in C++ are included in this repository.

License:MIT License


Languages

Language:C++ 100.0%