06.01.2015 Views

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

Cryptology - Unofficial St. Mary's College of California Web Site

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9.2. HILL CIPHERS 173<br />

We will be using a special type <strong>of</strong> 2 × 2 matrices known as involutions.<br />

They are special in that enciphering and deciphering is done using the same<br />

matrix. 6 We need to take care in setting up these matrices.<br />

Method for using Hill Ciphers:<br />

1. Pick any number a from 0 to 25.<br />

2. Pick a number b that is relatively prime to 26. Find its multiplicative<br />

inverse β from Figure 3.2.<br />

3. Compute c = (1 − a 2 )β%26 and d = (−a)%26.<br />

4. ( The enciphering ) ( and deciphering ) matrix is<br />

a b a b<br />

=<br />

c d (1 − a 2 .<br />

) · β −a<br />

Examples: Suppose we choose a = 7 and b = 9. From Figure 3.2 b’s inverse<br />

is 3 = β. Then (1 − a 2 ) · β = (1 − 7 2 ) × 3 = −146, ( so c = ) (−146)%26 = 12.<br />

7 9<br />

Since −7 ≡ 19 (mod 26), d = 19. So the matrix is .<br />

12 19<br />

(1) To( encipher ) ( ) matrix ( ) we first convert the plaintext into numbers: matrix<br />

13 20 9<br />

=<br />

, and then compute<br />

1 18 24<br />

So matrix → VSHZSR.<br />

(2) Decipher TIDDYVKM. 7<br />

( ) ( ) ( ) ( 7 9 13 22 V<br />

× ≡ = ,<br />

12 19 1 19 S)<br />

( ) ( ) ( ) (<br />

7 9 20 8 H<br />

× ≡ = ,<br />

12 19 18 26 Z)<br />

( ) ( ( ) ( 7 9 9 19 S<br />

× ≡ =<br />

12 19 24)<br />

18 R)<br />

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄<br />

Hill ciphers may be done with matrices <strong>of</strong> any square size, like 3 × 3 or 5 × 5,<br />

and the entries in the array can be chosen with more latitude than our examples<br />

suggest. See Exercise 9.11 for consideration <strong>of</strong> the latter.<br />

6 For the use <strong>of</strong> non-involutions in Hill ciphers see Exercise 9.11.<br />

7 multiply.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!