Application: Cryptography
Encrypting and decrypting messages with the Hill cipher — multiplying by the key matrix modulo the alphabet — and mounting a known-plaintext attack to recover a key.
5 exercises
Exercise 4.9.1
Encrypt the message “Rendezvous at dawn” using the Hill cipher with block size 3 and encryption matrix
Exercise 4.9.2
Decrypt the message “ERM DXYBJUWW.JWQLD,HL” using the Hill cipher with block size and encryption matrix
Exercise 4.9.3
Eve intercepts the following encrypted message sent by Bob:
“TGVXKHGSW,JU,JHYJSCDSBQIRPEV”
Eve knows that Alice uses a Hill cipher with block length 2, but she does not know the secret encryption matrix. Eve also knows that Bob begins all of his letters with “Hello”. Decrypt the message.
Exercise 4.9.4
Encrypt the message “Lost contact” using the block cipher of Definition 4.121 and the key .
Exercise 4.9.5
Decrypt the message “NRQEUAPOM GLFN”, using the block cipher of Definition 4.121 and the key . Hint: To decrypt, we must perform all the encryption steps in reverse. To undo a key mixing step, we subtract the relevant key components. To undo an S-box application, we apply the S-box in reverse. To undo a diffusion step, multiply by the inverse of the diffusion matrix.
Adapted from Matrix Theory and Linear Algebra © 2017–2026 Peter Selinger, Lyryx Learning, and Ken Kuttler. Licensed under CC BY 4.0. Source: Matrix Theory and Linear Algebra. Imported at revision d74bc3a.