🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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))
  1. A.4 3 True
  2. B.20 10 False
  3. C.4 10 True
  4. 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 →