rs Solution How RSA works (sorry if I use different variables from your class; the writing on the slide you included is too small to see): 1) Choose two distinct primes p and q. Let pq = n. 2) Calculate (n) = (pq) = (p - 1)(q - 1) (where is Euler\'s totient function, i.e., (n) = the number of positive integers less than or equal to n that are coprime to n) 3) Find an e such that gcd((n), e) = 1 4) Compute d such that de = 1 (mod (n)) (i.e., d the modular multiplicative inverse of e mod (pq)) e and n will be made public for people to encrypt messages with. d should remain private and will decrypt messages. (Obviously, (n) should also remain private as it would allow people to find d. For strong cryptography, n=pq should be sufficiently large that it is hard to factor and thus it is hard to guess (n).) To encrypt a message m (where m < n): 1) Compute c = me (mod n). This is the encrypted message. To decrypt c: 1) Compute cd (mod n) = (me)d (mod n) = (med) (mod n) =* m1 (mod n) = m. *this equality works because of Euler\'s Theorem, a^((p)) = 1 mod p (and here we have de = 1 (mod (n))) Your problem: Encrypt \"HOW ARE YOU\". First convert to an integer string as described. A = 00, B = 01, C = 02, D = 03, E = 04, F = 05, G = 06, H = 07, I = 08, J = 09, K = 10, L = 11, M = 12, N = 13, O = 14, P = 15, Q = 16, R = 17, S = 18, T = 19, U = 20, V = 21, W = 22, X = 23, Y = 24, Z = 25, space = 26. HOW ARE YOU = 07 14 22 26 00 17 04 26 24 14 20 = 0714222600170426241420 To encrypt, we need the message integer to be less than our chosen n, and n = 100. So we\'ll keep the message broken up into chunks of two. (Interestingly, n should be a product of two primes, and they\'ve given you an n that isn\'t. But we\'ll apply the RSA encryption algorithm anyway.) To encrypt each message chunk: c = me (mod n) where c is the encrypted message chunk, m is the original message chunk, e is the given value of 13, and n is the given value of 100. Encrypt each chunk: m = 07 c = 713 (mod 100) c = 7 m = 14 c = 1413 (mod 100) c = 44 m = 22 c = 2213 (mod 100) c = 52 m = 26 c = 2613 (mod 100) c = 76 m = 00 c = 013 (mod 100) c = 0 m = 17 c = 1713 (mod 100) c = 37 m = 04 c = 413 (mod 100) c = 64 m = 26 c = 2613 (mod 100) c = 76 m = 24 c = 2413 (mod 100) c = 24 m = 14 c = 1413 (mod 100) c = 44 m = 20 c = 2013 (mod 100) c = 0 Combine all the c\'s together into an encrypted message. For each m -> c chunk we have: 07 -> 07 14 -> 44 22 -> 52 26 -> 76 00 -> 00 17 -> 37 04 -> 64 26 -> 76 24 -> 24 14 -> 44 20 -> 00 So the whole encrypted message c is: 07 44 52 76 00 37 64 76 24 44 00 or 0744527600376476244400. c = 2613 (mod 100) c = 76.