{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

assignment8_sol

# assignment8_sol - MATH 135 Assignment 8 Solutions Hand-In...

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

MATH 135 Fall 2005 Assignment 8 Solutions Hand-In Problems Exercise 7-1: The following is known to be a simple substitution cipher. Break the code. PCTPG ANJHT GDURG NEIDV GPEWN LPHYJ AXJHR PTHPG BTHHP VTHHT CIIDW XHIGD DEHLT GTSXH VJXHT SQNIW TUDAA DLXCV HXBEA TBTIW DS Solution: The given ciphertext has 102 letters. Analyzing it we see that the letter T appears 10 times, and this is one the most repeated letters. Because the letter E is so common in the english language, an educated guess is to try the substitution cipher f that sends E to T . This corresponds to the function f : A → A defined by f ( x ) x + 15 (mod 26), where A 1, B 2, . . . . The inverse of this function would be f - 1 ( x ) x - 15 (mod 26). Applying f - 1 to the message we get PCTPG ANJHT GDURG NEIDV GPEWN LPHYJ AXJHR PTHPG Ciphertext ANEAR LYUSE ROFCR YPTOG RAPHY WASJU LIUSC AESAR Plaintext BTHHP VTHHT CIIDW XHIGD DEHLT GTSXH VJXHT SQNIW Ciphertext MESSA GESSE NTTOH ISTRO OPSWE REDIS GUISE DBYTH Plaintext TUDAA DLXCV HXBEA TBTIW DS Ciphertext EFOLL OWING SIMPL EMETH OD Plaintext With the correct spacing it would be “ an early user of cryptography was Julius Caesar messages sent to his troops were disguised by the following simple method” . Exercise 7-11: Given n = pq , p > q , and φ ( n ) = ( p - 1)( q - 1) prove that p + q = n - φ ( n ) + 1 and p - q = ( p + q ) 2 - 4 n. Solution: For the first part, n - φ ( n ) + 1 = pq - ( p - 1)( q - 1) + 1 = pq - ( pq - p - q + 1) + 1 = p + q. For the second part, ( p + q ) 2 - 4 n = p 2 + 2 pq + q 2 - 4 pq = p 2 - 2 pq + q 2 = ( p - q ) 2 . Since p - q > 0 , we have ( p + q ) 2 - 4 n = p - q . Exercise 7-14: Each integer n is the product of two primes p and q , and the Euler phi function φ ( n ) = ( p - 1)( q - 1). Determine the prime factors p and q . n = 71531, φ ( n ) = 70992 Solution: From Exercise 7-11, p + q = n - φ ( n ) + 1 = 71531 - 70992 + 1 = 540 p - q = ( p + q ) 2 - 4 n = 540 2 - 4(71531) = 74

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

View Full Document
Adding the two equations, 2 p = 614 so p = 307. Since p - q = 74 and p = 307, then q = 233. Check: (233)(307) = 71531 and (232)(306) = 70992. Exercise 7-28: Encrypt each message M , using the RSA public key ( e, n ) and the square and multiply algorithm. M = 2041, ( e, n ) = (13 , 3599) Solution: To encrypt the message M we have to calculate [ M 13 ] in Z 3599 . Using the square and multiply algorithm, 13 = (1101) 2 = 8 + 4 + 1 and 2041 2 1638 (mod 3599) 2041 4 1638 2 1789 (mod 3599) 2041 8 1789 2 1010 (mod 3599) 2041 13 = 2041 8 · 2041 4 · 2041 1010 · 1789 · 2041 (mod 3599) 192 · 2041 (mod 3599) 3180 (mod 3599) So the enciphered message of M is C = 3180. Exercise 7-36: Use the Chinese Remainder Theorem to decrypt each received ciphertext C , using the RSA private key ( d, n ) where n = pq . C = 1120, d = 5051, p = 79, q = 131 Solution: We calculate C d modulo p and modulo q and then combine using the Chinese Remainder Theorem to get C d modulo n . Look first at C 5051 modulo 79. We can simplify the calculation by recognizing that since C 0 (mod 79), then C 78 1 (mod 79). This means that C 78 q 1 (mod 79) for any integer q . Since 5051 = 64(78) + 59, then C 5051 ( C 78 ) 64 C 59 C 59 (mod 79). This drastically reduces the power which we have to work with.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 9

assignment8_sol - MATH 135 Assignment 8 Solutions Hand-In...

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

View Full Document
Ask a homework question - tutors are online