Challenges
Euler's function and RSA key
Cryptography
Medium
Euler's function
Solves: 8
Euler's function and RSA key
Author: CyberSamSU
Points
35
Euler's totient function φ(n) is the number of integers from 1 to n that are coprime with n. For a prime number, this is very simple: φ(p) = p - 1, because all numbers from 1 to p-1 are coprime with p.
The function is multiplicative: if p and q are distinct prime numbers, φ(p·q) = (p-1)·(q-1). According to Euler's theorem, a^φ(n) ≡ 1 (mod n) — this is a generalization of Fermat's Little Theorem and this is exactly what RSA uses.
In RSA, given the public exponent e, the private exponent will be d ≡ e⁻¹ (mod φ(n)). Based on the following data, find d.
p = 247721017340933
q = 235511774384629
e = 65537
Answer: only a number — in decimal format, without spaces and additional characters (for example 1234).
To submit a flag, log in.