Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment 4 Solutions - Ideas in Mathematics | MATH 170, Assignments of Mathematics

Material Type: Assignment; Professor: So; Class: IDEAS IN MATHEMATICS; Subject: Mathematics; University: University of Pennsylvania; Term: Spring 1999;

Typology: Assignments

2009/2010

Uploaded on 03/28/2010

koofers-user-nv9
koofers-user-nv9 🇺🇸

10 documents

1 / 8

Toggle sidebar

Related documents


Partial preview of the text

Download Assignment 4 Solutions - Ideas in Mathematics | MATH 170 and more Assignments Mathematics in PDF only on Docsity!

Math 170 Assignment #4 Solutions

2.5-4). Both p = 5 and q = 19 are indeed prime. Thus m = (p − 1)(q − 1) = 72, and clearly e = 11 has no factors in common with m. Given d = 59, y = 9, we easily check that:

e × d − m × y = 11 × 59 − 72 × 9 = 649 − 648 = 1

2.5-16). (a) To compute (5^600 mod 7), we first note that φ(7) = 6. Since gcd(5, 7) = 1, we have by Fermat’s Little Theorem:

(5^600 mod 7) = (5^6 ×^100 mod 7) = ((5^6 )^100 mod 7) = (5^6 mod 7)^100 = (1 mod 7)^100 = (1 mod 7) (b) Similarly, to compute (8^1000000 mod 11) we note that φ(11) = 10 and that gcd(8, 11) = 1, so Fermat’s Little Theorem gives:

(8^1000000 mod 11) = (8^10 ×^100000 mod 11) = ((8^10 )^100000 mod 11) = (8^10 mod 11)^100000 = (1 mod 11)^100000 = (1 mod 11)

2.5-19). If p divides n, say n = p × m for some m ≥ 1, then np−^1 = pp−^1 × mp−^1. In particular p divides np−^1 , hence (np−^1 mod p) = (0 mod p).

2.5-21). Recall that in RSA, the factorization of the modular number m is needed in order to compute φ(m). φ(m) is then used to compute the decryption number d by finding a solution (d, y) to the equation:

e × d − φ(m) × y = 1

Hence if we knew the factorization of m, or could compute it easily, then it would be short work to find a solution to this equation via the Euclidean algorithm. Hence we would obtain the decryption number, which needs to be known only to the receiver for RSA to be secure.

Find gcd(99, 42) and a pair x, y such that 99x + 42y = gcd(99, 42). Substituting from the bottom up, like Professor Ackerman taught we have:

99 = 2 × 42 + 15 → 99 − 2 × 42 = 15 42 = 2 × 15 + 12 → 42 − 2 × 15 = 12 15 = 1 × 12 + 3 → 15 − 1 × 12 = 3 12 = 4 × 3 + 0 → 3 = gcd(99, 42)

15 − 12 = 3 (second to last equality) 15 − (42 − 2 × 15) = 3 (substituting third to last equality) 15 − 42 + 2 × 15 = 3 3 × 15 − 42 = 3 3 × (99 − 2 × 42) − 42 = 3 (substituting fourth to last equality) 3 × 99 − 6 × 42 − 42 = 3 3 × 99 − 7 × 42 = 3 Alternatively, substituting from the top down yields: 99 = 2 × 42 + 15 → 99 − 2 × 42 = 15 42 = 2 × 15 + 12 → 42 − 2 × 15 = 42 − 2 × (99 − 2 × 42) = 5 × 42 − 2 × 99 = 12 15 = 1 × 12 + 3 → 15 − 1 × 12 = (99 − 2 × 42) − 1 × (5 × 42 − 2 × 99) = 3 × 99 − 7 × 42 = 3 12 = 4 × 3 + 0 → 3 = gcd(99, 42) = 3 × 99 − 7 × 42

Either way, we find that x = 3, y = −7 is a solution.

Find gcd(2000, 101) and a pair x, y such that 2000x + 101y = gcd(2000, 101). Bottom up approach:

2000 = 19 × 101 + 81 → 2000 − 19 × 101 = 81 101 = 1 × 81 + 20 → 101 − 1 × 81 = 20 81 = 4 × 20 + 1 → 81 − 4 × 20 = 1 20 = 20 × 1 + 0 → 1 = gcd(2000, 101)

81 − 4 × 20 = 1 (second to last equality) 81 − 4 × (101 − 1 × 81) = 1 (substituting third to last equality) 81 − 4 × 101 + 4 × 81 = 1 5 × 81 − 4 × 101 = 1 5 × (2000 − 19 × 101) − 4 × 101 = 1 (substituting fourth to last equality) 5 × 2000 − 95 × 101 − 4 × 101 = 1 5 × 2000 − 99 × 101 = 1 Top down approach:

2000 = 19 × 101 + 81 → 2000 − 19 × 101 = 81 101 = 1 × 81 + 20 → 101 − 1 × 81 = 101 − 1 × (2000 − 19 × 101) = 20 × 101 − 2000 = 20 81 = 4 × 20 + 1 → 81 − 4 × 20 = (2000 − 19 × 101) − 4 × (20 × 101 − 2000) = 5 × 2000 − 99 × 101 = 1 20 = 20 × 1 + 0 → 1 = gcd(2000, 101) = 5 × 2000 − 99 × 101

Either way we have that x = 5, y = −99 is a solution.

Find gcd(2001, 102) and x, y such that 2001x + 102y = gcd(2001, 102). Bottom up approach:

2001 = 19 × 102 + 63 → 2001 − 19 × 102 = 63 102 = 1 × 63 + 39 → 102 − 1 × 63 = 39 63 = 1 × 39 + 24 → 63 − 1 × 39 = 24 39 = 1 × 24 + 15 → 39 − 1 × 24 = 15 24 = 1 × 15 + 9 → 24 − 1 × 15 = 9 15 = 1 × 9 + 6 → 15 − 1 × 9 = 6 9 = 1 × 6 + 3 → 9 − 1 × 6 = 3 6 = 2 × 3 + 0 → 3 = gcd(2001, 102)

9 − 1 × 6 = 3 (second to last equality) 9 − 1 × (15 − 1 × 9) = 3 (substituting third to last equality) 9 − 1 × 15 + 1 × 9 = 3 2 × 9 − 1 × 15 = 3 2 × (24 − 1 × 15) − 1 × 15 = 3 (substituting fourth to last equality) 2 × 24 − 2 × 15 − 1 × 15 = 3 2 × 24 − 3 × 15 = 3 2 × 24 − 3 × (39 − 1 × 24) = 3 (substituting fifth to last equality) 2 × 24 − 3 × 39 + 3 × 24 = 3 5 × 24 − 3 × 39 = 3 5 × (63 − 1 × 39) − 3 × 39 = 3 (substituting sixth to last equality) 5 × 63 − 5 × 39 − 3 × 39 = 3 5 × 63 − 8 × 39 = 3 5 × 63 − 8 × (102 − 1 × 63) = 3 (substituting seventh to last equality) 5 × 63 − 8 × 102 + 8 × 63 = 3 13 × 63 − 8 × 102 = 3 13 × (2001 − 19 × 102) − 8 × 102 = 3 (substituting eighth to last equality) 13 × 2001 − 247 × 102 − 8 × 102 = 3 13 × 2001 − 255 × 102 = 3

Top down approach:

2001 = 19 × 102 + 63 → 2001 − 19 × 102 = 63 102 = 1 × 63 + 39 → 102 − 1 × 63 = 102 − 1 × (2001 − 19 × 102) = 20 × 102 − 2001 = 39 63 = 1 × 39 + 24 → 63 − 1 × 39 = (2001 − 19 × 102) − 1 × (20 × 102 − 2001) = 2 × 2001 − 39 × 102 = 24 39 = 1 × 24 + 15 → 39 − 1 × 24 = (20 × 102 − 2001) − 1 × (2 × 2001 − 39 × 102) = 59 × 102 − 3 × 2001 = 15 24 = 1 × 15 + 9 → 24 − 1 × 15 = (2 × 2001 − 39 × 102) − 1 × (59 × 102 − 3 × 2001) = 5 × 2001 − 98 × 102 = 9 15 = 1 × 9 + 6 → 15 − 1 × 9 = (59 × 102 − 3 × 2001) − 1 × (5 × 2001 − 98 × 102) = 157 × 102 − 8 × 2001 = 6 9 = 1 × 6 + 3 → 9 − 1 × 6 = (5 × 2001 − 98 × 102) − 1 × (157 × 102 − 8 × 2001) = 13 × 2001 − 255 × 102 = 3 6 = 2 × 3 + 0 → 3 = gcd(2001, 102) = 13 × 2001 − 255 × 102

Either way we have that x = 13, y = −255 is a solution.

EX-8). (a) What is φ(24)? (b) What is 7^65 mod 24? (a) 24 = 2^3 × 3, so by the formula given in class:

φ(24) = 24 ×

( 2 − 1

)

×

( 3 − 1

)

= 8

(b) Since gcd(7, 24) = 1, we know that 7^8 mod 24 = 1 mod 24. Therefore we have:

765 mod 24 = 7^8 ×8+1^ mod 24 = ((7^8 )^8 × (7^1 )) mod 24 = (1 mod 24)^8 × (7 mod 24) = 7 mod 24

EX-9). (a) What is φ(11 × 252 )? (b) How many numbers less than or equal to 400 have a factor in common with 400? (a) 11 × 252 = 11 × 54 , so by the formula given in class:

φ(11 × 54 ) = (11 × 54 ) ×

( 11 − 1

)

×

( 5 − 1

)

= 5000

(b) Since φ(400) is the number of numbers less than or equal to 400 with no factor in common with 400, there must be 400 − φ(400) = 400 − 160 = 240 numbers less than or equal to 400 which share a factor in common with 400 (since every number either does or does not share a common factor, and φ(400) counts those which do not).

EX-10). Suppose Jon is sending Alice a message with m = 11 × 13 and encryption number e = 7. (a) What is φ(m)? (b) What is the decryption number d? (c) Suppose Jon’s encoded message is 24, then what was the original message? (a) φ(11 × 13) = (11 × 13) ×

(

11 − 1

)

×

(

13 − 1

)

= 120

(b) Since e × d ≡ 1 mod φ(m), we need to find d, y such that 7d = 120y + 1 or equivalently 7d − 120 y = 1. Carrying through Euclid’s algorithm, we have:

120 = 17 × 7 + 1 → 120 − 17 × 7 = 1 7 = 7 × 1 + 0 → 1 = gcd(120, 7) = 1 × 120 − 17 × 7 (1)

Thus d = − 17 , y = 1 is a solution.

(c) Now working with the encoded message 24, the decoded message M is given by:

M = (24−^17 mod 143) = ((24−^1 )^17 mod 143) = (24−^1 mod 143)^17

To find (24−^1 mod 143), we need a number u such that 24u ≡ 1 mod 143, so carrying through Euclid’s algorithm gives:

143 = 5 × 24 + 23 → 143 − 5 × 24 = 23 24 = 1 × 23 + 1 → 24 − 1 × 23 = 24 − (143 − 5 × 24) = 6 × 24 − 143 = 1

Thus u = 6 works and (24−^1 mod 143) = (6 mod 143). Therefore we have:

M = (6 mod 143)^17 = (6 mod 143)^4 ×4+ = (6^4 mod 143)^4 × (6 mod 143) = (9 mod 143)^4 × (6 mod 143) = (9^4 mod 143) × (6 mod 143) = (126 mod 143) × (6 mod 143) = (126 × 6 mod 143) = (41 mod 143)

Thus Jon’s original message M was 41. 41, Jon? You go through all that work to encrypt the number 41? Seriously Jon, for your own good get a life.

Alternatively, since d is negative, we can avoid the hassles of finding the modular inverse of (24 mod 143) by making d positive. We can do this by adjusting the expression for gcd(120, 7) found in (1) above:

1 = 1 × 120 − 17 × 7 = 1 × 120 −(7 × 120) + (7 × 120) − 17 × 7 = [1 × 120 − (7 × 120)] + [(120 × 7) − 17 × 7] = [− 6 × 120] + [103 × 7]

Thus d = 103, y = −6 is also a solution to the original equation 7d = 120y + 1, and this time d is positive. Hence we can use d = 103 as our decryption number. Now we take the encoded message 24 and raise it to the 103rd^ power mod 143.

This gives:

M = 24^103 mod 143 = (24^2 ×51+1) mod 143 = ((24^2 ) mod 143)^51 × (24 mod 143) = (4 mod 143)^51 × (24 mod 143) = (4 mod 143)^7 ×7+2^ × (24 mod 143) = (4^7 mod 143)^7 × (4^2 mod 143) × (24 mod 143) = (82 mod 143)^7 × (16 mod 143) × (24 mod 143) = (82 mod 143)^2 ×3+1^ × (16 mod 143) × (24 mod 143) = (82^2 mod 143)^3 × (82 mod 143) × (16 mod 143) × (24 mod 143) = (3 mod 143)^3 × (82 mod 143) × (16 mod 143) × (24 mod 143) = (27 mod 143) × (82 mod 143) × (16 mod 143) × (24 mod 143) = (27 × 82 × 16 × 24 mod 143) = (850176 mod 143) = (41 mod 143)

Again we see that our oringal message M was 41. I sure hope Alice appreciates all the hard work we put into figuring out what exactly Jon was trying to tell her. Like Jon, she probably needs a life too.