EXAMPLE 14 Linear Cipher

To illustrate a linear cipher, we encrypt the message ADVANCE using the formula and decrypt the message ANQANHQ that was encrypted using the formula .

Message A D V A N C E
Position 0 3 21 0 13 2 4
7 70 448 7 280 49 91
New position 7 18 6 7 20 23 13
Encrypted message H S G H N X E

To decrypt ANQANHQ, we see from Table 17.4 that the decryption value for 21 is 5, so our decryption formula is . To make calculations easier, it is better to replace by a positive integer by observing that when using modulo 26, we may add 26 to any integer without changing the value. Thus, , and our formula becomes . (Or use Google to obtain —.)

Message A N Q A N H Q
Position 0 13 16 0 13 7 16
17 82 97 17 82 52 97
New position 17 4 19 17 4 0 19
Decrypted message R E T R E A T