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.

234 CHAPTER 12. RSA<br />

In both <strong>of</strong> these examples the quotient played an insignificant role. What,<br />

then, <strong>of</strong> the old exponent remains The remainder. Both 125 and 236 were<br />

replaced by their remainder when divided by p − 1. But “replacing by the<br />

remainder” is just another way <strong>of</strong> saying that we are doing modular arithmetic!<br />

We can summarize this as the following:<br />

Theorem 4 Fermat’s Theorem Restated: If p is a prime number and p does<br />

not divide a, then a b ≡ a b′ (mod p), where b%(p − 1) = b ′ .<br />

Less formally, when doing powers modulo p, we may work on the exponent<br />

modulo p − 1.<br />

Examples:<br />

(1) Compute 6 191 %19.<br />

Since 19 doesn’t divide 6 we can use Fermat’s theorem. Since 191%18 =<br />

11, we know that 6 191 ≡ 6 11 (mod 19). This last is easily computed to be<br />

17, which is our answer.<br />

(2) Compute 12 360 (mod 17).<br />

17 doesn’t divide 12, and 360%16 = 8, so 12 360 ≡ 12 8 ≡ 15 (mod 17). So<br />

the answer is 15.<br />

(3) Compute 23 465 (mod 43).<br />

23 465 ≡ 23 3 ≡ 41 (mod 43). The answer is 41.<br />

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

12.2 Complication I: a small one<br />

The examples we’ve done were carefully chosen so that we ended up with a fairly<br />

small number raised to a fairly small number. What if the base was too large for<br />

a calculator to handle this computation For example, what if we wanted 233 125<br />

(mod 41) By Fermat’s Theorem this is the same as 233 5 (mod 41). But 233 5<br />

is still too large for most calculators. What can we do Easy: we are doing<br />

modular arithmetic, and 233%41 = 28. We then have the string <strong>of</strong> equivalences<br />

233 125 ≡ 233 5 ≡ 28 5 ≡ 3 (mod 41).<br />

We are now doing “double modular arithmetic”, modulo p on the base and<br />

modulo p − 1 on the exponent.

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

Saved successfully!

Ooh no, something went wrong!