Skip to main content
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).

Hints 3
Opening a hint reduces the points you get for solving this challenge.
Hint 1 −1 pts Log in
Hint 2 −3 pts Log in
Hint 3 −4 pts Log in
To submit a flag, log in.

First solvers

1. Лазиз 04.10.2026
2. Mirjaxon Qaxxarov 26.10.2026
3. Odam 06.11.2026
4. ya_d0na 11.11.2026
5. Doston Allayarov 12.11.2026
6. Jasmin Xuseinova 15.11.2026
7. milanchka_26 19.11.2026
8. Abdinazarova 19.11.2026
9. farang1z_06 20.11.2026
10. Zulxumor 23.11.2026