Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

MATH 173A, SAMPLE FINAL

2 August 2023

One point out of 40 on the inal will be assigned for your pdf upload being organized and easy to read (for example, the question numbers should be clearly indicated and should be in consecutive order 1, 2, ...).

1. Assume Bob,s RsA modulus is N = 119 = 7 . 17 and his encryption exponent is e = 91.

a. compute Bob,s secret decryption exponent d using the Extended Euclidean Algorithm. show your work. (Express your inal answer d as a positive number.)

b. How many steps will it take for Bob to recover Alice,s secret message using the Fast power- ing Algorithm, if computing a product modulo N counts as one step?

2. Assume Eve knows an RsA modulus N and an encryption, decryption pair e and d. Describe in as much detail as possible the procedure for using this information to eficiently factor N.

3. For each of the tasks below, identify the computation it requires as well as the fast algorithm used for performing that computation.  some computations and algorithms may be used more than once, and some may not be used. No justiication is necessary.

Steps in the RSA algorithm.

1. Bob chooses e relatively prime to Ψ(N). (Assume Bob knows Ψ(N) already.) 2. Alice computes c = 从e  mod N.

3. Bob computes d such that e . d 三 1 mod Ψ(N). (Assume Bob knows Ψ(N) already.) 4. Bob computes from d and 从e  mod N.

computation.

a. gcd

b. factorization into primes

c. e-th root modulo m (for some modulus m)

d. modular exponentiation

e. discrete logarithm

f. multiplicative inverse modulo m (for some modulus m)

Algorithm.

i. Fast powering Algorithm (also called square-and-Multiply)

ii. Euclidean Algorithm

iii. Extended Euclidean Algorithm

iv. No known fast algorithm

4. Give three examples of computations (like what is described in the “computations” list above) that are relevant to Math 173A and for which there is no known fast algorithm.  (For example, for which we would not expect a modern computer to be able to perform that calculation on a general 500-bit input.) For each of your three examples, say in a few wordshow it is relevant to Math 173A.

5. we would like to determine whether or not the number 7039 is prime. Some data is given in the table below.

i

1

2

879

880

1759

1760

3519

3520

5399

5400

7037

7038

8797

8798

7i mod 7039

7

49

2440

3002

4320

2084

7038

7032

4733

4975

5028

1

4320

2084

a. If we use the Fermat primality test with base 7, what do we learn?  Briely explain your answer.

b. If we use the Miller-Rabin primality test with base 7, what do we learn? Briely explain your answer.

6. The basic idea behind many factorization algorithms is to use the difference of squares formula x2 − y2 = (x + y)(x − y). There is also a difference of cubes formula

x3 — g3  = (x — g)(x2 十 xg 十 g2 ).

What GCD computation can be performed in the hope that it yields a prime factor of 42281, given the following data? (you do not need to make the GCD computations.)

7. In the context of RSA, which one of the following is typically easy to compute (meaning it could

be completed quickly on a computer)? Briely explain why that computation is easy.

i. Given N (but not its factorization N = p . q), ind Ψ(N), where Ψ denotes the Euler phi- function.

ii. Given N (but not its factorization N = p . q), inde such that gcd(e, Ψ(N)) = 1. iii. Given N (but not its factorization N = p . q),e, and x, ind xe  mod N.

iv. Given N (but not its factorization N = p . q) and e, indd such that ed 三 1 mod Ψ(N).

8. Assume N = pq is an RSA modulus, assume a2  三 b2  mod N, and assume a bmod N. what can you say about gcd(a 十 b, N)? Explain your answer.

9. Imagine a version of RSA that uses as its modulus N = p (where p is a prime) rather than n = p . q, but all other details are kept the  same.  Explain why this would not be a secure cryptosystem.

10. what is the primary feature that distinguishes public key cryptosystems (like Elgamal and RSA) from private key cryptosystems?

11. Imagine the united States government has posted a list of one billion prime numbers p which are of a suitable size to produce an RSA modulus.  Eve knows that Bob has created his RSA modulus N from these prime numbers, so she begins multiplying pairs of the primes, hoping to ind N. So for example, she computes p1  . p2 , thenp1  . p3 , ..., thenp1  . p1000000000 , thenp2  . p3 . Before going on top2 .p4 , she notices it has taken her computer an hour to get this far, and she is only one billionth of the way done. what advice would you give to Eve in her goal of factoring N?