← Quiz: Cryptography Basics: all 10 questions
Quiz: Cryptography Basics · Question 7 of 10
What does this print? (code)
What does this print?
p, g, a, b = 23, 5, 4, 3
A, B = pow(g, a, p), pow(g, b, p)
print(A, B, pow(B, a, p) == pow(A, b, p))
- A.4 3 True
- B.20 10 False
- C.4 10 True
- D.4 10 False
Answer & explanation
Correct answer: 4 10 True
5^4 mod 23 = 625 mod 23 = 4 and 5^3 mod 23 = 125 mod 23 = 10; both sides reach the same shared key.
Can you get the rest right without peeking?
Take the timed Quiz: Cryptography Basics quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →