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.

4.4. DECIPHERING DECIMATION AND LINEAR CIPHERS 63<br />

Theorem 2 (The Extended Euclidean Algorithm) Given two integers n<br />

and k with n > k, construct the table<br />

q<br />

r<br />

c<br />

n<br />

0<br />

⋆<br />

k<br />

1<br />

· · ·<br />

· · ·<br />

· · ·<br />

∗<br />

q<br />

by, at each step, from<br />

form<br />

a b<br />

a b r<br />

α β<br />

α β α − qβ<br />

quotient and r the remainder are computed from a ÷ b. Then<br />

⋆<br />

g<br />

d<br />

0<br />

where q the<br />

1. This process eventually terminates by producing a 0 in the “remainder”<br />

line.<br />

2. The last non-zero entry in the remainder line is gcd(n, k).<br />

3. At each step, β × k ≡ b (mod n). In particular, if d is the entry in the<br />

coefficient line directly below the gcd g = gcd(n, k), then a × d ≡ gcd(n, k)<br />

(mod n).<br />

4. When n and k are relatively prime, d is the inverse <strong>of</strong> i modulo n.<br />

We haven’t formally proven all <strong>of</strong> this important theorem, although all <strong>of</strong><br />

the necessary ingredient have been stated. See any text on number theory, such<br />

as [KRosen], for the missing parts. Nonetheless, the theorem does explain the<br />

oddities in division we noticed at the end <strong>of</strong> Section 3.2.<br />

Examples: Examples <strong>of</strong> Division in Modular Arithmetic.<br />

(1) 3x ≡ 9 (mod 7) has the usual solution x = 3.<br />

Since gcd(7, 3) = 1 divides 9 there is exactly gcd = 1 solution.<br />

(2) 3x ≡ 9 (mod 12) has the usual solution x = 3, but also x = 7 and x = 11.<br />

Since gcd(12, 3) = 3 divides 9 there are gcd = 3 solutions.<br />

(3) 3x ≡ 8 (mod 7) has the unusual solution x = 5.<br />

Since gcd(7, 3) = 1 divides 8 there is gcd = 1 solution.<br />

(4) 3x ≡ 8 (mod 12) has no solutions.<br />

Since gcd(12, 3) = 3 doesn’t divide 8 there are no solutions.<br />

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

4.4 Deciphering Decimation and Linear Ciphers<br />

We now finally understand what needs to be “proper” about the multiplying<br />

keynumbers in Decimation and Linear Ciphers. When we work modulo 26,

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

Saved successfully!

Ooh no, something went wrong!