Euler's Theorem is a fundamental result in number theory with significant implications in the field of public-key cryptography, particularly in the RSA encryption algorithm. This theorem is named after the Swiss mathematician Leonhard Euler and is closely related to Euler's Totient Function, often denoted as φ(n).
Euler's Theorem states that for any integer
and
that are coprime (i.e., gcd(a, n) = 1), the following congruence holds:
![]()
where φ(n) is Euler's Totient Function, which counts the number of integers up to
that are coprime with
.
To understand Euler's Theorem in depth, it is essential to first comprehend Euler's Totient Function, the concept of modular arithmetic, and the notion of coprimality.
Euler's Totient Function
Euler's Totient Function, φ(n), is a important function in number theory. For a given positive integer
, φ(n) is defined as the number of positive integers less than
that are coprime with
. Two numbers are coprime if their greatest common divisor (gcd) is 1.
For example:
– φ(1) = 1 (since the only number less than 1 is 0, and 0 is coprime with 1 by convention)
– φ(2) = 1 (the number 1 is coprime with 2)
– φ(3) = 2 (the numbers 1 and 2 are coprime with 3)
– φ(4) = 2 (the numbers 1 and 3 are coprime with 4)
For a prime number
, φ(p) = p – 1 because all numbers less than a prime number
are coprime with
.
For a composite number
that can be factored into prime factors, Euler's Totient Function can be calculated using the formula:
![]()
where
are the distinct prime factors of
.
For example, for
, which has prime factors 2 and 3:
![]()
Modular Arithmetic
Modular arithmetic is a system of arithmetic for integers, where numbers "wrap around" upon reaching a certain value, known as the modulus. The notation
means that
and
have the same remainder when divided by
.
For example:
–
because when 7 is divided by 5, the remainder is 2.
–
because when 14 is divided by 11, the remainder is 3.
Coprimality
Two integers
and
are said to be coprime if their greatest common divisor (gcd) is 1. This is a important condition for Euler's Theorem to hold.
For example:
– 8 and 15 are coprime because gcd(8, 15) = 1.
– 8 and 12 are not coprime because gcd(8, 12) = 4.
Proof of Euler's Theorem
The proof of Euler's Theorem leverages the properties of Euler's Totient Function and modular arithmetic. Here's a sketch of the proof:
1. Consider the set of integers {1, 2, …, n-1} that are coprime with
. There are φ(n) such integers.
2. Let this set be denoted as {a_1, a_2, …, a_φ(n)}.
3. Multiply each element of this set by
, where
is an integer coprime with
.
4. The resulting set {a \cdot a_1, a \cdot a_2, …, a \cdot a_φ(n)} is also a set of φ(n) integers, each of which is distinct modulo
. This is because multiplication by
(which is coprime with
) permutes the set of residues modulo
.
5. Since the set {a_1, a_2, …, a_φ(n)} and {a \cdot a_1, a \cdot a_2, …, a \cdot a_φ(n)} are the same modulo
, their products are congruent modulo
:
![]()
6. Simplifying the right-hand side, we get:
![]()
7. Since
is not zero modulo
, we can cancel it from both sides of the congruence, yielding:
![]()
This completes the proof of Euler's Theorem.
Application in Cryptography
Euler's Theorem is particularly significant in the RSA encryption algorithm, which is a widely used public-key cryptographic system. RSA relies on the difficulty of factoring large composite numbers and uses properties of Euler's Totient Function and modular arithmetic.
In RSA, two large prime numbers
and
are chosen, and their product
is used as the modulus for both the public and private keys. The totient φ(n) is calculated as:
![]()
A public exponent
is chosen such that 1 <
< φ(n) and gcd(e, φ(n)) = 1. The private exponent
is then computed as the modular multiplicative inverse of
modulo φ(n), i.e.,
![]()
The public key is
, and the private key is
.
To encrypt a message
, the sender computes the ciphertext
as:
![]()
To decrypt the ciphertext
, the receiver computes the original message
as:
![]()
Euler's Theorem ensures that this decryption process works correctly because:
![]()
Given that
, there exists an integer
such that:
![]()
Thus,
![]()
This demonstrates the correctness and security of the RSA algorithm, underpinned by Euler's Theorem.
Example
Consider a small example to illustrate Euler's Theorem:
Let
. The integers that are coprime with 10 are {1, 3, 7, 9}, so φ(10) = 4.
Let
, which is coprime with 10.
According to Euler's Theorem:
![]()
Calculating
:
![]()
![]()
Hence,
![]()
This example confirms Euler's Theorem for
and
.
Euler's Theorem is a cornerstone in the field of number theory and cryptography, providing the mathematical foundation for secure encryption methods such as RSA. Its implications extend beyond cryptography into various areas of mathematics and computer science.
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?

