Challenges
Extended Euclidean algorithm
Cryptography
Easy
Extended Euclidean
Solves: 12
Extended Euclidean algorithm
Author: CyberSamSU
Points
15
The simple Euclidean algorithm only returns the GCD. The Extended Euclidean algorithm, however, gives even more: it finds such integers u and v that p·u + q·v = EKUB(p, q). This equation is called Bézout's identity.
Why is this important? If GCD(p, q) = 1, looking at the equation modulo mod q gives p·u ≡ 1 (mod q) — meaning u is exactly the modular inverse of p. The private key d in RSA is also found this way.
The following two prime numbers are given. Find u satisfying the equation p·u + q·v = 1. The condition for the solution to be unique: 0 < u < q.
p = 947026073491
q = 602317430573
Answer: only a number — in decimal format, without spaces and additional characters (for example 1234).
To submit a flag, log in.