![]() |
VOOZH | about |
Hill Cipher is a polygraphic substitution cipher based on linear algebra. In this method, each letter of the alphabet is represented by a number modulo 26, commonly using the scheme A = 0, B = 1, …, Z = 25.
Example:
Input : Plaintext: ACT
Key: GYBNQKURP
Output: Ciphertext: POHInput: Plaintext: GFG
Key: HILLMAGIC
Output: Ciphertext: SWK
For encryption ,
Illustration
We have to encrypt the message 'ACT' (n=3).The key is 'GYBNQKURP' which can be written as the nxn matrix ,
👁 CipherkeyThe message 'ACT' is written as vector,
👁 message vectorThe enciphered vector is given as,
👁 enciphered vectorwhich corresponds to ciphertext of 'POH'
Ciphertext: POH
For decryption,
Illustration
The inverse of the matrix the key "GYBNQKURP" will be ,
👁 inverse matrixNow the Ciphertext is "POH",
👁 DecryptSo, the result is "ACT".
Decrypted Text: ACT