Solve the Algorithm Step by Step - I'll Validate Your Answers!
Step 1️⃣: Choose Prime Numbers (p and q)
Select two different prime numbers. Check if they're prime using the button.
Step 2️⃣: Calculate the Modulus (n)
Write the algorithm/formula for calculating n. You can use the variable names (p, q) and the system will substitute the actual numbers.
Your Values:
p = 61
q = 53
Step 3️⃣: Calculate Euler's Totient φ(n)
Write the algorithm for Euler's totient function. This is CRITICAL to RSA—you need to count how many numbers are coprime to n.
Your Values:
p = 61
q = 53
Step 4️⃣: Choose and Validate Public Exponent (e)
Choose e where: 1 < e < φ(n) and gcd(e, φ(n)) = 1
Step 5️⃣: Calculate Private Exponent (d)
Find d such that: (e × d) ≡ 1 (mod φ(n))
This is the secret private exponent—it's the inverse of e. You can enter a value for d and check if it's correct!
💡 Hint: Use the Extended GCD algorithm to find d. When you multiply e × d and divide by φ(n), the remainder should be exactly 1.
Your Values:
e = -
φ(n) = -
Step 6️⃣: Your RSA Key Pair
Once all parameters are validated, here are your keys:
📚 What You've Built:
Your public key (e, n) is safe to share with anyone. Your private key (d, n) is your secret—never share it!
💡 Next Steps:
Share your public key with a friend
Have them encrypt a message using your public key
Only you can decrypt it with your private key d
Try the encryption/decryption section below to test it!