Challenges
Euclidean algorithm: GCD
Cryptography
Easy
GCD and Euclidean algorithm
Solves: 18
Euclidean algorithm: GCD
Author: CyberSamSU
Points
12
The greatest common divisor (GCD) of two numbers is the largest number that divides both of them without a remainder. This operation occurs very often in cryptography: for example, in RSA, e and φ(n) must be coprime, meaning GCD(e, φ(n)) = 1 is required.
The Euclidean algorithm finds this in a few steps. The idea is very simple: EKUB(a, b) = EKUB(b, a mod b), and when b = 0 the answer is equal to a. Even for large numbers, this finishes in a few dozen steps.
Find the GCD of the following two numbers.
a = 4395877176460349132051753825
b = 6971305226299864251445650827
Answer: only a number — in decimal format, without spaces or additional characters (for example 1234).
Theory: learn the topic
To submit a flag, log in.