Hill Cipher

Here we talk about the Hill Cipher, a method that encrypts more than one letter of the plaintext message at a time. In this example, we use the matrix defined by \[ A=\left(\begin{array}{cc} 3 & 5 \\ 1 & 2 \end{array}\right) \] To perform our encryption. Below we define both the encoding schemes, as well as all necessary functions to implement the Hill Cipher in SageMath. Run the following cell to define all functions, then proceed to the examples below.

Example

In this encryption scheme, we need all matrix calculations to be performed mod 26, as a result, we must use MatrixSpaces again in SageMath.