16

I am creating a function which generates a privateKey for RSA. The underlying algorithm for generating a privateKey is the Extended Euclidean algorithm. According to Wikipedia, the output of this algorithm is a "Bézout's identity".

I never heard of Bézout's identity before and wanted to know what it's importance is and what is it used for, but I can't find a clear answer. Googling "What is the importance of Bézout's identity?" yields no relevant results. The closest thing I could find was a discussion on Wikipedia:Talk

The point is that Bézout's identity is an important result which is used in many areas of mathematics. In particular it is one of the starting tools (with modular arithmetic) of Diophantine equation theory

To someone who does not have an extensive mathematical background the above discussion is meaningless. Can someone describe the importance and use-cases for Bézout's identity in layman terms?

  • 5
    One purpose of Bézout's is to solve congruences related to the Chinese Remainder Theorem.

    If $px+qy=1$ and $$z\equiv m\pmod p\z\equiv n\pmod q$$

    Then $$z\equiv npx+mqy\pmod{pq}$$

    – Thomas Andrews Dec 27 '16 at 23:41
  • 4
    An important application of the Bezout's identity for the gcd is computing modular inverses. This works not only for integers but also for polynomials over a field. For example, a special case is computing inverses of quadratic numbers $,\alpha = a+b\sqrt{d},$ by $ $ rationalizing denominators, i.e $\ \dfrac{1}{\alpha} = \dfrac{\bar \alpha}{\alpha\bar\alpha}., $ The inversion of complex numbers $,\alpha = a+b, i,$ is a special case of such modular Bezout inversion. If this of interest then let me know and I can elaborate in an answer. – Bill Dubuque Dec 28 '16 at 00:26

5 Answers5

19

Given integers $m,n$ (not both zero), Bezout's identity finds integers $x,y$ that satisfy: $$xm+ny=\gcd(m,n)$$

One important application is if we know $\gcd(m,n)=1$. Then, we can take the above equation modulo $n$ to get $$xm\equiv 1\pmod{n}$$ This is useful, because we have found the multiplicative inverse to $m$, modulo $n$.

We have a constructive (and fast) way to find $x,y$, using the extended Euclidean algorithm.

One reason a multiplicative inverse is useful is: suppose we want to find some integer $z$ satisfying the modular equation $$mz\equiv t\pmod{n}$$ Once we have found $x$, as above, we may multiply both sides by $x$ to get $$z\equiv 1z\equiv (xm)z\equiv xt\pmod{n}$$

vadim123
  • 82,796
12

Bezout's identity turns the qualitative statement "two numbers are relatively prime" into an equation which can be manipulated. For a proof or exercise about relatively prime numbers, one of the common first steps is to turn that condition into Bezout's identity.

Elle Najt
  • 20,740
7

Let's say you have two $a, b \in \Bbb{Z}$. Since they are in $\Bbb{Z}$, they have some greatest common divisor, which I'll call $d$. What Bezout's Identity states is that there exist $x, y \in \Bbb{Z}$ such that: $$ax+by=d$$ The way we find $x, y$ is through the Extended Euclidean Algorithm. If you recall, the regular Euclidean Algorithm takes in $a, b$ and then gives us the greatest common divisor, but the Extended Eucliden Algorithm takes $a, b$ and then gives us the greatest common divisor $d$ along with $x, y$.

Now, to find the RSA private key, we need that $d \equiv e^{-1} \pmod {\phi(n)}$ where $\gcd(e, \phi(n))=1$. Thus, by Bezout's Identity, we get there exist $x, y$ such that: $$ex+\phi(n)y=1 \implies ex=1-\phi(n)y \implies ex \equiv 1 \pmod {\phi(n)}$$ Thus, $ex$ is the private key, so we can find the private key by figuring out $x$ using the Extended Euclidean Algorithm.

Noble Mushtak
  • 18,402
  • 28
  • 44
4

one very important consequence of bezout's theorem is that it tells you when the number $a$ has an inverse $\bmod m$.

This is of course when $(a,m)=1$.

The reason why the inverse exists is because $sa+tm=1$ has solutions in $s$ and $t$.

This result is very important, as it tells us that the multative group $\bmod m$ has $\varphi(m)$ elements. Which is the reason why euler's theorem holds.

Asinomás
  • 105,651
4

Another important use of Bézout's identity is in the proof of Euclid's Lemma:

If a prime $p$ divides the product $ab$ of two integers $a$ and $b$, $p$ must divide at least one of those integers $a$ and $b$.

Euclid's Lemma can be used to prove the fundamental theorem of arithmetic:

Every integer greater than 1 either is prime itself or is the product of prime numbers, and that this product is unique, up to the order of the factors.

As its name implies, the fundamental theorem of arithmetic is a cornerstone of number theory.

PM 2Ring
  • 4,844