×
1 Choose EITC/EITCA Certificates
2 Learn and take online exams
3 Get your IT skills certified

Confirm your IT skills and competencies under the European IT Certification framework from anywhere in the world fully online.

EITCA Academy

Digital skills attestation standard by the European IT Certification Institute aiming to support Digital Society development

LOG IN TO YOUR ACCOUNT

CREATE AN ACCOUNT FORGOT YOUR PASSWORD?

FORGOT YOUR PASSWORD?

AAH, WAIT, I REMEMBER NOW!

CREATE AN ACCOUNT

ALREADY HAVE AN ACCOUNT?
EUROPEAN INFORMATION TECHNOLOGIES CERTIFICATION ACADEMY - ATTESTING YOUR PROFESSIONAL DIGITAL SKILLS
  • SIGN UP
  • LOGIN
  • INFO

EITCA Academy

EITCA Academy

The European Information Technologies Certification Institute - EITCI ASBL

Certification Provider

EITCI Institute ASBL

Brussels, European Union

Governing European IT Certification (EITC) framework in support of the IT professionalism and Digital Society

  • CERTIFICATES
    • EITCA ACADEMIES
      • EITCA ACADEMIES CATALOGUE<
      • EITCA/CG COMPUTER GRAPHICS
      • EITCA/IS INFORMATION SECURITY
      • EITCA/BI BUSINESS INFORMATION
      • EITCA/KC KEY COMPETENCIES
      • EITCA/EG E-GOVERNMENT
      • EITCA/WD WEB DEVELOPMENT
      • EITCA/AI ARTIFICIAL INTELLIGENCE
    • EITC CERTIFICATES
      • EITC CERTIFICATES CATALOGUE<
      • COMPUTER GRAPHICS CERTIFICATES
      • WEB DESIGN CERTIFICATES
      • 3D DESIGN CERTIFICATES
      • OFFICE IT CERTIFICATES
      • BITCOIN BLOCKCHAIN CERTIFICATE
      • WORDPRESS CERTIFICATE
      • CLOUD PLATFORM CERTIFICATENEW
    • EITC CERTIFICATES
      • INTERNET CERTIFICATES
      • CRYPTOGRAPHY CERTIFICATES
      • BUSINESS IT CERTIFICATES
      • TELEWORK CERTIFICATES
      • PROGRAMMING CERTIFICATES
      • DIGITAL PORTRAIT CERTIFICATE
      • WEB DEVELOPMENT CERTIFICATES
      • DEEP LEARNING CERTIFICATESNEW
    • CERTIFICATES FOR
      • EU PUBLIC ADMINISTRATION
      • TEACHERS AND EDUCATORS
      • IT SECURITY PROFESSIONALS
      • GRAPHICS DESIGNERS & ARTISTS
      • BUSINESSMEN AND MANAGERS
      • BLOCKCHAIN DEVELOPERS
      • WEB DEVELOPERS
      • CLOUD AI EXPERTSNEW
  • FEATURED
  • SUBSIDY
  • HOW IT WORKS
  •   IT ID
  • ABOUT
  • CONTACT
  • MY ORDER
    Your current order is empty.
EITCIINSTITUTE
CERTIFIED

What is an extended eulers algorithm?

by Emmanuel Udofia / Tuesday, 06 August 2024 / Published in Cybersecurity, EITC/IS/CCF Classical Cryptography Fundamentals, Introduction to public-key cryptography, Number theory for PKC – Euclidean Algorithm, Euler’s Phi Function and Euler’s Theorem

The Extended Euclidean Algorithm is a fundamental mathematical tool in the field of number theory, which finds extensive application in public-key cryptography. It is an enhancement of the classical Euclidean Algorithm, which is used to compute the greatest common divisor (GCD) of two integers. The extended version not only computes the GCD but also finds the coefficients of Bézout's identity, which are integers x and y such that for given integers a and b:

    \[ ax + by = \text{GCD}(a, b) \]

This property is particularly useful in cryptographic applications, such as the RSA algorithm, where modular inverses are required.

Euclidean Algorithm Recap

To appreciate the extended version, one must first understand the classical Euclidean Algorithm. The Euclidean Algorithm is based on the principle that the GCD of two numbers also divides their difference. The algorithm can be described by the following recursive procedure:

1. Given two integers a and b where a \geq b, compute the remainder r of the division of a by b.
2. Replace a with b and b with r.
3. Repeat the process until b becomes zero. The non-zero remainder at this stage will be the GCD of the original pair of integers.

Mathematically, this can be represented as:

    \[ \text{GCD}(a, b) = \text{GCD}(b, a \mod b) \]

Extended Euclidean Algorithm

The Extended Euclidean Algorithm builds upon this by keeping track of additional coefficients that express the GCD as a linear combination of the original integers a and b. The steps involved are:

1. Initialize:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-461e4425b1c1d13146fb485100df163b_l3.png" height="42" width="267" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    x_0 &= 1, & y_0 &= 0, \\    x_1 &= 0, & y_1 &= 1    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

These are the coefficients for the initial values of a and b.

2. Perform the Euclidean Algorithm while updating the coefficients:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-636acdcb338e41c8a1af625157ce14af_l3.png" height="16" width="262" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    r_0 &= a, & r_1 &= b \\    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

For each iteration i, compute:

    \[    q_i = \left\lfloor \frac{r_{i-1}}{r_i} \right\rfloor    \]

Update the remainders:

    \[    r_{i+1} = r_{i-1} - q_i r_i    \]

Update the coefficients:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-e60eeb7fe9625fe52d12ac7c8f2aef4e_l3.png" height="39" width="141" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    x_{i+1} &= x_{i-1} - q_i x_i \\    y_{i+1} &= y_{i-1} - q_i y_i    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

3. Continue this process until r_{i+1} = 0. At this point, r_i will be the GCD of a and b, and the coefficients x_i and y_i will satisfy:

    \[    ax_i + by_i = \text{GCD}(a, b)    \]

Example

Consider the integers a = 30 and b = 20. The goal is to find the GCD of these numbers and express it as a linear combination of 30 and 20.

1. Apply the Euclidean Algorithm:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-e620482f0a5f7691c583381914e3985e_l3.png" height="40" width="120" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    30 &= 20 \cdot 1 + 10 \\    20 &= 10 \cdot 2 + 0 \\    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

The GCD is 10.

2. Use the Extended Euclidean Algorithm:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-26f3f4c17c9f50c8722cd94874af8a6c_l3.png" height="42" width="264" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    x_0 &= 1, & y_0 &= 0 \\    x_1 &= 0, & y_1 &= 1 \\    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

First iteration:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-a5aabe301eddd6f1101aef77673f66d5_l3.png" height="122" width="162" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    q_1 &= \left\lfloor \frac{30}{20} \right\rfloor = 1 \\    r_2 &= 30 - 1 \cdot 20 = 10 \\    x_2 &= 1 - 1 \cdot 0 = 1 \\    y_2 &= 0 - 1 \cdot 1 = -1 \\    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

Second iteration:

    \[    <span class="ql-right-eqno">   </span><span class="ql-left-eqno">   </span><img src="https://eitca.org/wp-content/ql-cache/quicklatex.com-30b7e8c1705a5f7cfb752b8eecec8d80_l3.png" height="123" width="162" class="ql-img-displayed-equation quicklatex-auto-format" alt="\begin{align*}    q_2 &= \left\lfloor \frac{20}{10} \right\rfloor = 2 \\    r_3 &= 20 - 2 \cdot 10 = 0 \\    x_3 &= 0 - 2 \cdot 1 = -2 \\    y_3 &= 1 - 2 \cdot (-1) = 3 \\    \end{align*}" title="Rendered by QuickLaTeX.com"/>    \]

At this point, r_2 = 10 is the GCD, and the coefficients are x_2 = 1 and y_2 = -1. Thus, we have:

    \[ 30 \cdot 1 + 20 \cdot (-1) = 10 \]

Application in Public-Key Cryptography

One of the critical applications of the Extended Euclidean Algorithm in public-key cryptography is in the RSA algorithm, particularly in finding the modular inverse. In RSA, the private key d is the modular inverse of e modulo \phi(n), where \phi is Euler's totient function. Specifically, d must satisfy:

    \[ ed \equiv 1 \pmod{\phi(n)} \]

This is equivalent to finding d such that:

    \[ ed - k\phi(n) = 1 \]

for some integer k. Using the Extended Euclidean Algorithm, we can find d and k efficiently.

Python Implementation

Here is a Python implementation of the Extended Euclidean Algorithm:

python
def extended_gcd(a, b):
    if a == 0:
        return b, 0, 1
    gcd, x1, y1 = extended_gcd(b % a, a)
    x = y1 - (b // a) * x1
    y = x1
    return gcd, x, y

# Example usage
a = 30
b = 20
gcd, x, y = extended_gcd(a, b)
print(f"GCD: {gcd}, x: {x}, y: {y}")

This function recursively computes the GCD and the coefficients x and y. When run with a = 30 and b = 20, it outputs:

    \[ \text{GCD: 10, x: 1, y: -1} \]

The Extended Euclidean Algorithm is a powerful extension of the classical Euclidean Algorithm, providing not only the GCD of two integers but also the coefficients of Bézout's identity. This capability is important in various cryptographic applications, particularly in computing modular inverses needed for algorithms like RSA. Understanding and implementing this algorithm is fundamental for anyone involved in the field of public-key cryptography and number theory.

Other recent questions and answers regarding Number theory for PKC – Euclidean Algorithm, Euler’s Phi Function and Euler’s Theorem:

  • What does Fermat’s Little Theorem state?
  • What is EEA ?
  • Can public key be used for authentication if the asymmetric relation in terms of complexity in computing keys is reversed?
  • What are eulers theorem used for?
  • What are eulers theorem used for?
  • Can a private key be computed from public key?
  • What is a public key?
  • What is a public key?
  • What is the parameter t of the extended eulers algoritm?
  • What is an extended eulers algorithm?

View more questions and answers in Number theory for PKC – Euclidean Algorithm, Euler’s Phi Function and Euler’s Theorem

More questions and answers:

  • Field: Cybersecurity
  • Programme: EITC/IS/CCF Classical Cryptography Fundamentals (go to the certification programme)
  • Lesson: Introduction to public-key cryptography (go to related lesson)
  • Topic: Number theory for PKC – Euclidean Algorithm, Euler’s Phi Function and Euler’s Theorem
Tagged under: Cybersecurity, EUCLIDEAN ALGORITHM, Extended Euclidean Algorithm, Number Theory, Public Key Cryptography, RSA
Home » Cybersecurity » EITC/IS/CCF Classical Cryptography Fundamentals » Introduction to public-key cryptography » Number theory for PKC – Euclidean Algorithm, Euler’s Phi Function and Euler’s Theorem » » What is an extended eulers algorithm?

Certification Center

USER MENU

  • My Account

CERTIFICATE CATEGORY

  • EITC Certification (105)
  • EITCA Certification (9)

What are you looking for?

  • Introduction
  • How it works?
  • EITCA Academies
  • EITCI DSJC Subsidy
  • Full EITC catalogue
  • Your order
  • Featured
  •   IT ID
  • EITCA reviews (Medium publ.)
  • About
  • Contact

EITCA Academy is a part of the European IT Certification framework

The European IT Certification framework has been established in 2008 as a Europe based and vendor independent standard in widely accessible online certification of digital skills and competencies in many areas of professional digital specializations. The EITC framework is governed by the European IT Certification Institute (EITCI), a non-profit certification authority supporting information society growth and bridging the digital skills gap in the EU.
Eligibility for EITCA Academy 90% EITCI DSJC Subsidy support
90% of EITCA Academy fees subsidized in enrolment

    EITCA Academy Secretary Office

    European IT Certification Institute ASBL
    Brussels, Belgium, European Union

    EITC / EITCA Certification Framework Operator
    Governing European IT Certification Standard
    Access contact form or call +32 25887351

    Follow EITCI on X
    Visit EITCA Academy on Facebook
    Engage with EITCA Academy on LinkedIn
    Check out EITCI and EITCA videos on YouTube

    Funded by the European Union

    Funded by the European Regional Development Fund (ERDF) and the European Social Fund (ESF) in series of projects since 2007, currently governed by the European IT Certification Institute (EITCI) since 2008

    Information Security Policy | DSRRM and GDPR Policy | Data Protection Policy | Record of Processing Activities | HSE Policy | Anti-Corruption Policy | Modern Slavery Policy

    Automatically translate to your language

    Terms and Conditions | Privacy Policy
    EITCA Academy
    • EITCA Academy on social media
    EITCA Academy


    © 2008-2026  European IT Certification Institute
    Brussels, Belgium, European Union

    TOP
    CHAT WITH SUPPORT
    Do you have any questions?
    We will reply here and by email. Your conversation is tracked with a support token.