Algorithms

Hill Cipher

The Hill cipher is a polygraphic substitution cipher based on linear algebra. It encrypts blocks of text using matrix multiplication with a key matrix. In a 2x2 implementation, it processes two letters at a time, converting them to numbers (A=0, B=1, etc.), multiplying them with a 2x2 key matrix, and converting the results back to letters modulo 26. Decryption uses the inverse of the key matrix. Think of it as transforming pairs of letters through a mathematical function - like feeding coordinates through a geometric transformation. The strength lies in its mathematical properties and block encryption nature.

Time Complexity

Best CaseO(n)

Average CaseO(n)

Worst CaseO(n)

Implementation

Encoding

Encode your message using the Hill cipher