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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

12.3. COMPLICATION II: A SUBSTANTIAL ONE 237<br />

(2) For 57:<br />

So 57 = 32 + 16 + 8 = +1.<br />

remainder power <strong>of</strong> 2<br />

57 ÷2 = 28.5 1 1<br />

28 ÷2 = 14 0 2<br />

14 ÷2 = 7 0 4<br />

7 ÷2 = 3.5 1 8<br />

3 ÷2 = 1.5 1 16<br />

1 ÷2 = .5 1 32<br />

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

In fact, every positive integer can be written as a sum <strong>of</strong> the powers <strong>of</strong> 2: 1,<br />

2, 4, 8, ..., using each power at most once. This is the binary expansion <strong>of</strong><br />

the number, and the process we have just described finds this expansion.<br />

We can use the two processes, squaring using the powers <strong>of</strong> two, and the<br />

binary expansion process, together.<br />

Example: Find the binary expansion <strong>of</strong> 159. Use it to compute 23 159 %171.<br />

159 ÷ 2 = 79.5 1 1<br />

79 ÷ 2 = 39.54 1 2<br />

39 ÷ 2 = 19.5 1 4<br />

19 ÷ 2 = 9.5 1 8<br />

9 ÷ 2 = 4.5 1 16<br />

4 ÷ 2 = 2 0 32<br />

2 ÷ 2 = 1 0 64<br />

1 ÷ 2 = .5 1 128<br />

Thus 159 = 128 + 16 + 8 + 4 + 2 + 1. Next, compute the required powers <strong>of</strong> 23:<br />

23 ≡ 23 (mod 171),<br />

23 2 = 23 2 ≡ 16 (mod 171),<br />

23 4 = (23 2 ) 2 ≡ (16) 2 ≡ 85 (mod 171),<br />

23 8 = (23 4 ) 2 ≡ (85) 2 ≡ 43 (mod 171),<br />

23 16 = (23 8 ) 2 ≡ (43) 2 ≡ 139 (mod 171),<br />

23 32 = (23 16 ) 2 ≡ (139) 2 ≡ 169 (mod 171),<br />

23 64 = (23 32 ) 2 ≡ (169) 2 ≡ 4 (mod 171), and<br />

23 128 = (23 64 ) 2 ≡ (4) 2 ≡ 16 (mod 171).<br />

Using the powers that we need gives<br />

23 159 = 23 128 · 23 16 · 23 8 · 23 4 · 23 2 · 23 ≡ 16 · 43 · 85 · 16 · 23 ≡ 163 (mod 171).<br />

⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄ ⋄

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

Saved successfully!

Ooh no, something went wrong!