MIT6_042JF10_rec05_sol

MIT6_042JF10_rec05_sol - 6.042/18.062J Mathematics for...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
6.042/18.062J Mathematics for Computer Science September 24, 2010 Tom Leighton and Marten van Dijk Notes for Recitation 5 1 Exponentiation and Modular Arithmetic Recall that RSA encryption and decryption both involve exponentiation. To encrypt a message m , we use the following equation: m = rem ( m e ,n ) m e (mod n ) . And to decrypt a message m , we use m = rem (( m ) d ,n ) ( m ) d (mod n ) . In practice, e and d might be quite large. But even for relatively small values of these e variables, the quantities m and ( m ) d can be very difficult to compute directly. Fortunately, there are tractable and efficient methods for carrying out exponentiation of large integer powers modulo a number. Let’s say we are trying to encrypt a message. First, note that: rem ( a b,c ) a b (mod c ) · · rem ( a,c ) rem ( b,c ) (mod c ) · = rem (( rem ( a,c ) rem ( b,c )) ,c ) · This principle extends to an arbitrary number of factors, such that: a 1 · a 2 · ... a n rem ( a 1 ,c ) rem ( a 2 ,c ) · ... rem ( a n ,c ) (mod c ) · · · We illustrate this point with an example: Example: Find rem (23 61 19 , 17). · · We could ±nd the remainder of 23 61 19 = 26657 divided by 17, but that would be a lot · · of unnecessary work! Instead, we notice the fact that 23 6 (mod 17), 61 10 (mod 17), and 19 2 (mod 17). Therefore, 23 61 19 6 10 2 (mod 17). · · · · Similarly, we can reduce the remainder of 6 10 2 divided by 17. We notice the fact that · · 10 2 = 20 3 (mod 17), so 6 10 2 6 3 = 18 1 (mod 17). We could have also calculated · · · · 6 10 = 60 9 (mod 17) to get the same answer 6 10 2 9 2 = 18 1 (mod 17). While · · · · both methods here were relatively simple to use, how you choose to associate your factors may sometimes greatly affect the difficulty of a calculation!
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Recitation 5 Let’s return to RSA. Here’s one way we might go about encrypting our message (though in a minute we’ll consider a more efficient technique). We can compute m = rem ( m
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 6

MIT6_042JF10_rec05_sol - 6.042/18.062J Mathematics for...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online