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.

236 CHAPTER 12. RSA<br />

(2) Compute 22 57 %61 (with fewer explanations).<br />

We have 57 = 32 + 16 + 8 + 1. Computing the powers,<br />

22 2 ≡ 15 (mod 61),<br />

22 4 = (22 2 ) 2 ≡ 15 2 ≡ 42 (mod 61),<br />

22 8 = (22 4 ) 2 ≡ (42) 2 ≡ 56 (mod 61),<br />

22 16 = (22 8 ) 2 ≡ (56) 2 ≡ 25 (mod 61), and<br />

22 32 = (22 16 ) 2 ≡ (25) 2 ≡ 15 (mod 61).<br />

Using the powers that we need gives<br />

22 57 = 22 32 · 22 16 · 22 8 · 22 ≡ 15 · 25 · 56 · 22 ≡ 47 (mod 61).<br />

Therefore 22 57 %61 = 47.<br />

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

In each <strong>of</strong> these examples we broke down the exponent into a sum <strong>of</strong> power<br />

<strong>of</strong> 2. 4 To make this process easier we need to find a way <strong>of</strong> determining which<br />

powers <strong>of</strong> 2 are needed. A simple on is as follows. At each step divide by 2. If<br />

this division has a remainder (the quotient has a .5 as a decimal) then indicate<br />

this with a 1, otherwise indicate this with a 0. Then repeat starting with the<br />

integer part <strong>of</strong> the quotient. End when the final quotient is .5, as it has no<br />

integer part to continue with.<br />

Examples: Find the needed powers for an exponent <strong>of</strong> 27 and 57.<br />

(1) For 27:<br />

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

27 ÷2 = 13.5 1 1<br />

13 ÷2 = 6.5 1 2<br />

6 ÷2 = 3 0 4<br />

3 ÷2 = 1.5 1 8<br />

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

So 27 as a 16, 8, 2 and 1 in it (that is 27 = 16 + 8 + 2 + 1).<br />

4 Why 2 and not, say, 3 Because every number can be expressed as a sum <strong>of</strong> powers <strong>of</strong> 2,<br />

allowing us to compute 22 57 %61 by performing simply a number <strong>of</strong> squarings. If we had used<br />

3 instead we would have needed to write 57 = 2 · 27 + 3, a sum <strong>of</strong> multiples <strong>of</strong> powers <strong>of</strong> 3.<br />

Using 2 means we don’t need multiples, which makes the calculations a bit easier.

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

Saved successfully!

Ooh no, something went wrong!