Skip to content
The Lumenary

Practice · Early undergraduate

Cryptography

Cryptography

Warm-upHuman

A toy RSA public key is (n,e)=(33,3)(n, e) = (33, 3), where 33=3⋅1133 = 3 \cdot 11. Encrypt the message m=5m = 5: compute c=me mod nc = m^e \bmod n.

Cryptography

Warm-upHuman

For the toy key p=5p = 5, q=11q = 11, n=55n = 55 and e=3e = 3, find the private exponent dd with 0<d<400 < d < 40 and ed≡1(mod(p−1)(q−1))ed \equiv 1 \pmod{(p - 1)(q - 1)}.

Cryptography

CoreHuman

With the key n=55n = 55, e=3e = 3, d=27d = 27, a ciphertext c=13c = 13 arrives. Decrypt it: find m=cd mod 55m = c^d \bmod 55. (Hint: you can check your answer by encrypting it.)

Cryptography

CoreHuman

Ama and Bolat use Diffie–Hellman with p=29p = 29 and g=2g = 2. Ama's secret is a=5a = 5, Bolat's is b=12b = 12. Ama sends A=25 mod 29=3A = 2^5 \bmod 29 = 3 and Bolat sends B=212 mod 29=7B = 2^{12} \bmod 29 = 7. What shared key do they compute?

Cryptography

CoreHuman

An attacker knows the public key (n,e)(n, e) of an RSA user. Which additional pieces of information would let the attacker compute the private exponent dd efficiently, with known methods? (Choose all that apply.)

Choose all that apply

Cryptography

StretchHuman

Textbook RSA with e=3e = 3 and a 2048-bit modulus nn is used to send a 100-bit number mm, as c=m3 mod nc = m^3 \bmod n. What can an eavesdropper do?

Choose one

Cryptography

CoreFormal

Which Lean statement is a true formalisation of RSA correctness, as proved in the lesson?

Choose one

Cryptography

StretchComputational

Implement pow_mod(b, e, n) by repeated squaring without using Python's three-argument pow: return be mod nb^e \bmod n. It must handle exponents with hundreds of digits instantly.

Runs entirely in your browser, in an isolated worker. Nothing is sent to a server.