Public-key cryptography, also known as asymmetric cryptography, is a fundamental concept in the field of cybersecurity. It involves the use of two distinct but mathematically related keys: a public key, which can be disseminated widely, and a private key, which must be kept confidential by the owner. The security of public-key cryptographic systems relies heavily on the computational difficulty of deriving the private key from the public key.
To understand why it is computationally infeasible to compute a private key from a public key, one must consider the mathematical underpinnings of public-key cryptography, particularly the number-theoretic principles and algorithms that form its foundation. These include the Euclidean Algorithm, Euler’s Phi Function, and Euler's Theorem.
Key Concepts in Public-Key Cryptography
1. Euclidean Algorithm
The Euclidean Algorithm is a method for finding the greatest common divisor (GCD) of two integers. The GCD of two integers a and b is the largest integer that divides both a and b without leaving a remainder. The Euclidean Algorithm is efficient and can be used to compute the GCD in a recursive manner. The steps are as follows:
1. Divide the larger number by the smaller number and obtain the remainder.
2. Replace the larger number with the smaller number and the smaller number with the remainder from step 1.
3. Repeat the process until the remainder is zero. The non-zero remainder just before this step is the GCD.
For example, to find the GCD of 48 and 18:
– 48 ÷ 18 = 2 remainder 12
– 18 ÷ 12 = 1 remainder 6
– 12 ÷ 6 = 2 remainder 0
Thus, the GCD of 48 and 18 is 6.
2. Euler’s Phi Function
Euler’s Phi Function, denoted as φ(n), counts the number of integers up to n that are relatively prime to n. Two numbers are relatively prime if their GCD is 1. For a prime number p, φ(p) = p – 1 because all numbers less than p are relatively prime to p. For a composite number n, the function can be calculated using the formula:
φ(n) = n * (1 – 1/p1) * (1 – 1/p2) * … * (1 – 1/pk)
where p1, p2, …, pk are the distinct prime factors of n. For example, if n = 15, which has prime factors 3 and 5:
φ(15) = 15 * (1 – 1/3) * (1 – 1/5) = 15 * (2/3) * (4/5) = 15 * 8/15 = 8
3. Euler’s Theorem
Euler’s Theorem states that for any integer a and n where a and n are coprime (i.e., GCD(a, n) = 1):
a^φ(n) ≡ 1 (mod n)
This theorem is pivotal in public-key cryptography, particularly in the RSA algorithm. It implies that raising a number to the power of φ(n) modulo n results in 1 when a and n are coprime.
RSA Algorithm: An Example of Public-Key Cryptography
The RSA algorithm is one of the most widely used public-key cryptosystems. It involves the following steps:
1. Key Generation:
– Choose two large prime numbers, p and q.
– Compute n = p * q.
– Compute φ(n) = (p – 1) * (q – 1).
– Choose an integer e such that 1 < e < φ(n) and GCD(e, φ(n)) = 1. This e becomes the public exponent.
– Compute the private exponent d as the modular multiplicative inverse of e modulo φ(n), i.e., d * e ≡ 1 (mod φ(n)).
The public key is (e, n) and the private key is (d, n).
2. Encryption:
– A message M is encrypted using the public key: C ≡ M^e (mod n).
3. Decryption:
– The ciphertext C is decrypted using the private key: M ≡ C^d (mod n).
Computational Infeasibility of Deriving Private Key from Public Key
The security of RSA hinges on the difficulty of the integer factorization problem. Given the public key (e, n), an adversary would need to factorize n into its prime components p and q to compute φ(n) and subsequently derive the private key d. The factorization of large integers is computationally hard, making it infeasible with current technology and algorithms.
Example
Consider a small RSA example:
– Choose p = 61 and q = 53.
– Compute n = 61 * 53 = 3233.
– Compute φ(n) = (61 – 1) * (53 – 1) = 3120.
– Choose e = 17 such that GCD(17, 3120) = 1.
– Compute d such that d * 17 ≡ 1 (mod 3120). Using the Extended Euclidean Algorithm, we find d = 2753.
The public key is (17, 3233) and the private key is (2753, 3233).
Encrypt a message M = 65:
– C ≡ 65^17 (mod 3233) = 2790.
Decrypt the ciphertext C = 2790:
– M ≡ 2790^2753 (mod 3233) = 65.
Mathematical Hardness and Security
The RSA algorithm's security is based on the difficulty of factorizing n. While the Euclidean Algorithm and Euler’s Theorem are efficient, the factorization of a large composite number n into its prime factors p and q is not. The best-known algorithms for factorization, such as the General Number Field Sieve (GNFS), have exponential complexity for large n, making the process infeasible for sufficiently large key sizes (e.g., 2048-bit keys).
Further, the security of public-key cryptographic systems is also reinforced by choosing large prime numbers and ensuring that the private key d remains confidential. Even if the public key (e, n) is known, without the factorization of n, deriving d is practically impossible.
In public-key cryptography, particularly in the RSA algorithm, it is computationally infeasible to derive the private key from the public key due to the hardness of the integer factorization problem. The mathematical principles underlying the Euclidean Algorithm, Euler’s Phi Function, and Euler’s Theorem ensure that while the public key can be freely distributed, the private key remains secure, provided that sufficiently large primes are used in the key generation process.
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?
- 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?
- What is an extended eulers algorithm?

