\( \def\ZZ{\mathbb{Z}} \def\GG{\mathbb{G}} \def\HH{\mathbb{H}} \) Print this page and give the answers.

Name:______________________________     Alpha:________________________________ 
  1. [6pts] What is the smallest safe prime larger than 50? Justify your answer.
    Answer: 
    
    Reason:
    
    
    
    
  2. [6pts] In Python, compute the following expressions (copy and paste):
     pow(111111111, 2222222, 33333333333333333333333333333)
     (111111111**2222222) % 33333333333333333333333333333
  3. [2pts] For $(g, p, y) = (4, 1907, 792)$, find the discrete logarithm $\log_g y \pmod p$. Write a Python script to answer the question.
    
    
    
  4. [10pts] The following shows an execution of the Diffie-Hellman key exchange protocol. Fill in the blanks. Don't use a computer for this. You will see a similar problem in the exam.
    prime number p = 47
    generator g = 3
    
    
    
    Alice:                                  A = ____                  Bob:
    exponent a = 4                      --------------->              exponent b = 5             
    
    
                                            B = ____
                                       <---------------
    
    Ka = (___)^(___) mod ___ = ____                                   Kb = (___)^(___) mod ___ = ____
    
    ------
    * Ka must be equal to Kb.