Posts

Hill Cipher program in c

Image
   Introduction to Hill Cipher In classical cryptography, the Hill cipher is a polygraphic substitution cipher based on linear algebra. Invented by Lester S. Hill in 1929, it was the first polygraphic cipher in which it was practical (though barely) to operate on more than three symbols at once. The following discussion assumes an elementary knowledge of matrices . This technique encrypt plaintext in matrix form of 2x2 or 3x3.when plaintext in 2x2 then key value also in 2x2 matrix and 3x3 use then 3x3 matrix key.Using matrix we can encrypt 4 or 9 plaintext letters at once. Hill Cipher Theory First of all need key in matrix form of 2x2 or 3x3 depends of requirement. Here, we have formula to find Cipher text  ( Encryption ) CT = K*PT mod 26   Where, CT = CipherText ,               K = Key ,               PT = PlainText. We have also formula to find Plain text from Cipher text ( Decryption ) PT = K -1 *CT mod 26   Where, CT = CipherText ,             

Playfair Cipher program in c

Image
  Introduction to Playfair The Playfair cipher or Playfair square or Wheatstone-Playfair cipher is a manual symmetric encryption technique( Use same key for encryption of plaintext and decryption of ciphertext) and was the first literal digram substitution cipher. The scheme was invented in 1854 by Charles Wheatstone, but bears the name of Lord Playfair for promoting its use.  This technique encrypts pairs of letters (bigrams or digrams), instead of single letters as in the simple substitution cipher and rather more complex cipher systems then in use. History of playfair It was however later used for tactical purposes by British forces in the Second Boer War and in World War I and for the same purpose by the British and Australians during World War II. This was because Playfair is reasonably fast to use and requires no special equipment - just a pencil and some paper. A typical scenario for Playfair use was to protect important but non-critical secrets du