Hill Cypher

The Hill Cipher uses matrix multiplication to encrypt a message. First, you need to assign two numbers to each letter in the alphabet and also assign numbers to space, . , and ? or !. The key space is the set of all invertible matrices over Z29. 29 was chosen because there are 29 characters and it is also a prime number, which solves some problems later on. The encryption function, in its most basic form looks like this:

ek(x)=k (x)

Here is an example:

To encrypt the message, we take two letters at a time and make a vector. Thus "Fo" becomes the vector