Home /permanent

Extended Euclidean Algorithm

Extended Euclidean Algorithm is an extension of the Euclidean Algorithm which, as well as finding the greatest common divisor of two integers aa and bb, also finds integers xx and yy such that:

ax+by=gcd⁡(a,b)ax + by = \gcd(a, b)

This is known as Bézout's identity.

It's commonly used to find the modular multiplicative inverse of a number (see Modular Arithmetic), which is a key step in generating keys for RSA.