RCM3720 Cryptography, Network and Computer Security

Laboratory Class 8: Modes of Encryption

We will investigate the different modes of encryption using the Hill (matrix) cryptosystem. Start off by entering some matrices: Check that you've entered everything correctly with Note that because the matrices were defined in terms of numbers mod 26, their product is automatically reduced mod 26. Now enter the following column vector: For this lab, rather than fiddling about with translations between letters and numbers, all our work will be done with numbers alone (in the range 0..25).


For electronic codebook mode, encryption is performed by multiplying each plaintext block by the matrix, and decryption by multiplying each ciphertext block by the inverse matrix:
    C =M.P ,  P =M  C
     i    i    i     i
where all arithmetic is performed mod 26.


For cipherblock chaining mode, the encryption formula for the Hill cryptosystem is
   C =M(P +C   )
    i    i  i-1
and decryption is
   P =M  C -C
    i     i  i-1


Output feedback mode works by creating a key stream, and then adding it to the plaintext to obtain the ciphertext. With the Hill system, and an initialization vector IV:
   k =IV,   k =Mk
    1        i   i-1
and then
   c =p +k
    i  i  i