4.1 Introduction
TLDR: This chapter introduces number theory, focusing on the properties of integers (). It briefly discusses the definition of integers and their importance as a foundation for more advanced mathematical concepts, particularly within computer science applications like cryptography.
4.1.1 Number Theory as a Mathematical Discipline
Number theory is the mathematical study of integers (), their properties, and the relationships between them. It’s a vast field with surprising connections to other areas of mathematics and numerous applications in computer science, especially in cryptography.
Historical Note:
While initially considered a “pure” area of mathematics (with little practical application), number theory’s importance in cryptography and other fields has dramatically increased in recent decades.
Key Areas of Study:
Number theory encompasses many subfields, including:
-
Prime Numbers: The study of prime numbers (integers divisible only by 1 and themselves) is fundamental. Questions about their distribution, the infinitude of primes, and efficient primality testing are central topics.
-
Divisibility and Congruences: Number theory explores divisibility relationships between integers (e.g., determining the greatest common divisor and least common multiple) and modular arithmetic (arithmetic performed within a finite set of remainders). Congruences are a core tool for studying these relationships.
-
Diophantine Equations: These are polynomial equations where only integer solutions are sought. Famous examples include Fermat’s Last Theorem and the Catalan conjecture. Finding efficient solutions or proving the absence of solutions are major challenges in this area.
-
Algebraic Number Theory: This area expands the study beyond rational numbers to include algebraic numbers (roots of polynomials with integer coefficients) and their properties. This has profound implications in understanding number systems.
4.1.2 What are the Integers?
Definition:
The integers, denoted by , are the set of all whole numbers, including positive, negative, and zero: .
Importance in Mathematics:
The integers form the basis for many areas of mathematics. They are used to build other number systems (rational numbers, real numbers, complex numbers), and they underlie concepts like divisibility, prime factorization, and modular arithmetic.
Axiomatic Treatment:
A rigorous treatment of number theory would start by formally defining the integers through axioms, but this isn’t feasible within the scope of this introductory chapter. This chapter relies on the intuitive understanding of the integers that most readers already possess. Later chapters will explore generalizations that extend concepts from integers to broader algebraic structures (like rings and fields).
Examples:
-
Example 4.1 (Goldbach Conjecture): Are there infinitely many prime pairs? (Pairs of prime numbers differing by 2, such as (3, 5), (5, 7), (11, 13), etc.). This is an unsolved problem in number theory.
-
Example 4.2 (Pythagorean Triples): Do positive integer solutions exist for ? Yes, many exist ; these form Pythagorean triples, such as (3, 4, 5) or (5, 12, 13).
-
Example 4.3 (Fermat’s Last Theorem): Does the equation have any positive integer solutions for any ? No ; this was famously proven by Andrew Wiles in 1994.
-
Example 4.4 (Catalan Conjecture): Does the equation have any positive integer solutions besides ? No, proven by Preda Mihăilescu in 2002.
These examples illustrate the kinds of questions explored in number theory, ranging from relatively straightforward problems to extremely difficult ones that have remained open for centuries. Many of these problems have deep connections to other areas of mathematics and to computer science, especially cryptography.
4.2 Divisors and Division
TLDR: This section formally defines divisors and the division algorithm (with remainders), introduces the concepts of greatest common divisors (GCD) and least common multiples (LCM), and presents the Euclidean algorithm for efficiently computing GCDs.
4.2.1 Divisors
Definition:
An integer is a divisor of an integer (denoted ) if there exists an integer such that . In this case, is a multiple of .
Examples:
- Example: because .
- Example: because .
- Example: because .
4.2.2 Division with Remainders
Theorem 4.1 (Division Algorithm):
For any integers and with , there exist unique integers (the quotient) and (the remainder) such that:
This theorem states that any integer can be uniquely expressed as a multiple of plus a remainder smaller than .
Proof:
-
Existence: Consider the set . This set contains non-negative integers. If , then . If , then for some (e.g. if and if ). The Well-Ordering Principle (every non-empty set of non-negative integers contains a smallest element) guarantees that has a smallest element, which we’ll call .
-
: Assume . Then for some non-negative integer . Since , we have for some integer . Substituting, we get , meaning . Since is non-negative, this means . However, , which contradicts the fact that is the smallest element in . Therefore, we must have .
-
Uniqueness: Assume there are two pairs of integers and that satisfy the conditions. Then , implying . If , then , so (since ). If , then without loss of generality, assume . Then . Since and , we must have , meaning , a contradiction. Hence, the pair is unique.
Simplified Proof Pls… 👉👈
Division Algorithm
For any integers and with , there exist unique integers (the quotient) and (the remainder) such that:
and .
Proof:
1. Existence:
We need to show that integers and exist.
- Define a set: Let .
This set includes all non-negative integers of the form for .
If , then gives .
If , we can pick such that . Hence, is non-empty.
- Smallest element: By the Well-Ordering Principle, has a smallest element, call it .
- By definition, for some integer .
- Therefore, with .
2. :
We now prove that .
- Assume . Then for some .
Substitute into , giving .
Rearranging, .
Since , . However, , contradicting that is the smallest element of .
Hence, . Combining this with , we get .
3. Uniqueness:
Finally, we prove that is unique.
- Suppose two pairs and satisfy and , where .
Subtracting, .
- The left-hand side is a multiple of , while .
The only way this holds is if , so .
Substituting into , we get .
Therefore, the pair is unique.
Conclusion:
For any integers and with , there exist unique integers and such that:
and .
Examples:
- If and , then , so and .
- If and , then , so and .
- If and , then , so and .
- If and , then , so and .
The remainder is often denoted as .
4.2.3 Greatest Common Divisors (GCD)
Definition:
The greatest common divisor (GCD) of two integers and , not both zero, denoted , is the largest positive integer that divides both and . If , and are said to be relatively prime.
Lemma 4.2:
For any integers , , and , .
Proof of Lemma 4.2:
We will prove this by showing that any common divisor of and is also a common divisor of and , and vice versa. This will establish that the set of common divisors is identical for both pairs, and therefore their greatest common divisors must be equal.
-
Any common divisor of and is a common divisor of and :
Let be a common divisor of and . This means that and . By definition, there exist integers and such that and . Then:
.
Since is an integer, this shows that . Therefore, is a common divisor of and .
-
Any common divisor of and is a common divisor of and :
Let be a common divisor of and . Then and . This means there exist integers and such that and . Then:
.
Since is an integer, this shows that . Therefore, is a common divisor of and .
-
Conclusion:
From steps 1 and 2, we’ve shown that the set of common divisors of is identical to the set of common divisors of . Since the sets of common divisors are the same, their greatest common divisors must also be the same. Therefore: .
The Euclidean Algorithm:
The Euclidean algorithm is an efficient method for computing the GCD of two integers. It relies on repeatedly applying the division algorithm and Lemma 4.2.
Algorithm:
To find where and :
- If , then return (as the GCD).
- Otherwise, let where (division algorithm).
- If , return (as the GCD).
- Otherwise, recursively compute using steps 1-3. This process continues until the remainder is 0. The last non-zero remainder is the GCD.
Example:
Find :
- ()
- ()
Therefore, .
Ideals in :
Definition: For , the ideal generated by and , denoted , is the set . Similarly, . An ideal is a subset of a ring that’s closed under addition and multiplication by ring elements.
Lemma 4.3: For any , there exists a such that .
- Proof: If , then . Otherwise, the set contains positive integers. Let be the smallest positive integer in . Clearly, because any multiple of is also in . Now take any . Then for some integers and with . Since and , we know that . If , we have a contradiction since was defined as the smallest positive integer. Therefore, , which means , so . Thus , and therefore .
Lemma 4.4: If , then .
-
Proof: Since , is of the form for some . Therefore, any common divisor of and divides . Since , it follows that and . Therefore, is a common divisor of and . Since any common divisor of and also divides , must be the greatest common divisor of and . Therefore .
-
Corollary 4.5: For (not both zero), there exist such that . This is a direct consequence of Lemmas 4.3 and 4.4.
4.2.4 Least Common Multiples (LCM)
Definition:
The least common multiple (LCM) of two positive integers and , denoted , is the smallest positive integer that is a multiple of both and .
Examples:
-
Example 4.4: . (Multiples of : ; multiples of : ; is the least common multiple).
-
Note that for any positive integers and . This provides an alternate method to find LCM.
4.3 Factorization into Primes
TLDR: This chapter focuses on the Fundamental Theorem of Arithmetic, which states that every integer greater than 1 can be uniquely factored into a product of prime numbers. The chapter presents a proof of this theorem using induction and explores related concepts like greatest common divisors (gcd), least common multiples (lcm), and the implications of unique factorization (e.g., proving the irrationality of the square root of a prime). It also includes an interesting digression into the relationship between prime numbers and music theory.
4.3.1 Primes and the Fundamental Theorem of Arithmetic
Definitions:
-
Prime Number: A positive integer is prime if its only positive divisors are 1 and itself.
-
Composite Number: A positive integer that is not prime is called composite. This means it has at least one divisor other than 1 and itself.
Fundamental Theorem of Arithmetic:
This theorem states that every integer greater than 1 can be expressed as a unique product of prime numbers. This is a fundamental result in number theory.
4.3.2 Proof of the Fundamental Theorem of Arithmetic
Existence of Prime Factorization
This part demonstrates that every integer greater than 1 can be written as a product of primes. We use proof by contradiction and the principle of well-ordering (every non-empty set of positive integers contains a least element).
Proof:
-
Assumption (for contradiction): Suppose there’s at least one integer greater than 1 that cannot be expressed as a product of primes.
-
Well-ordering principle: Among all such integers, there must be a smallest one; call it .
-
Contradiction: Since is not prime (otherwise it would trivially be a product of primes—itself), it must be composite. This means that it can be written as a product of two smaller integers, , with and .
-
Inductive argument: Because and are smaller than , and was assumed to be the smallest integer without a prime factorization, both and must be expressible as products of primes.
-
Final Contradiction: This means , which is the product , can also be expressed as a product of primes (the prime factors of a and b combined). This contradicts our initial assumption that cannot be expressed as a product of primes.
-
Conclusion: The initial assumption must be false, thus every integer greater than 1 can be factored into primes.
Uniqueness of Prime Factorization
This part shows that the prime factorization of any integer greater than 1 is unique, except for the order in which the prime factors are written. We again use proof by contradiction and rely on the following Lemma (proven below).
Proof:
-
Assumption (for contradiction): Suppose there is at least one integer greater than 1 with two distinct prime factorizations.
-
Well-ordering principle: Let be the smallest such integer. Then we can write:
where the and are prime numbers, and the and are positive integers. The two factorizations are assumed to be distinct.
-
Prime Divisibility: Since divides , and , must divide at least one of the (by Lemma 4.7). Because the are prime, this means must equal one of the . Without loss of generality, let’s assume .
-
Cancellation: We can divide both sides of the equation by , obtaining:
This gives us a smaller integer with (potentially) two distinct prime factorizations.
-
Contradiction: This contradicts the assumption that was the smallest integer with two distinct prime factorizations.
-
Conclusion: The assumption must be false; therefore, the prime factorization of any integer greater than 1 is unique (up to ordering).
Lemma 4.7: Euclid’s Lemma
Lemma: If a prime divides a product of integers, then divides at least one of the .
Proof (by induction): The base case () is trivial: If , then divides . For the inductive step, assume the lemma holds for products of integers. Consider a product of integers: . If divides this product, then either divides (in which case, by the induction hypothesis, divides at least one of ), or does not divide . In the latter case, , implying and are relatively prime. This implies that must divide (because otherwise, there is no way to get to divide the product ).
4.3.3 Expressing gcd and lcm
The greatest common divisor (gcd) and least common multiple (lcm) of two integers can be efficiently computed using their prime factorizations:
Let and be the prime factorizations of and (where some or might be 0 if a particular prime doesn’t appear in the factorization of or ).
Then:
4.3.4 Non-triviality of Unique Factorization *
The unique factorization property doesn’t hold in all algebraic structures. This is why the Fundamental Theorem of Arithmetic is significant; it highlights a specific property that makes the integers unique.
Examples:
-
Example 4.5 (Gaussian Integers): The Gaussian integers, , where , do have unique factorization into irreducible elements.
-
Example 4.6 (Twisted Gaussian Integers): The ring does not have unique factorization into irreducible elements. For example: .
4.3.5 Irrationality of Roots *
Theorem 4.8: Irrationality of Non-Square Roots
Theorem: The square root of a positive integer is irrational unless is a perfect square (i.e., for some integer ).
Proof (by contradiction):
We will prove this theorem using proof by contradiction and the Fundamental Theorem of Arithmetic (unique prime factorization).
-
Assumption: Assume, for the sake of contradiction, that is rational and is not a perfect square. This means we can express as a fraction , where and are integers, , and (meaning and are coprime – they share no common factors other than 1).
-
Squaring and Rearranging: Squaring both sides of the equation , we get:
Multiplying both sides by , we obtain:
-
Prime Factorization: By the Fundamental Theorem of Arithmetic, both and have unique prime factorizations. Consider a prime factor that appears in the prime factorization of . Because is not a perfect square, the exponent of in the prime factorization of must be odd (otherwise would be a perfect square).
-
Exponent Analysis: Let be the exponent of in the prime factorization of . Then the exponent of in the prime factorization of is , where is the exponent of in (which may be 0). Since is odd, is also odd.
However, the exponent of in the prime factorization of must be even (because it’s a perfect square). This means that if is in the prime factorization of , its exponent must be an even number.
-
Contradiction: We have arrived at a contradiction. The prime factorization of contains an odd number of factors of , while the prime factorization of contains an even number of factors of . However, , so their prime factorizations must be identical. This contradiction arises from our initial assumption that is rational and is not a perfect square.
-
Conclusion: Therefore, our initial assumption must be false. If is not a perfect square, then must be irrational.
4.3.6 A Digression to Music Theory *
The ratios of frequencies in harmonious musical intervals often involve small integers (e.g., the octave is a 2:1 frequency ratio, a perfect fifth is approximately 3:2). The unique prime factorization of integers plays a significant role in the mathematical analysis and understanding of musical harmony. This is an unexpected and fascinating application of prime numbers.
4.4 Some Basic Facts About Primes *
TLDR: This section discusses the distribution of prime numbers and the computational challenges of primality testing, particularly relevant for cryptography where large prime numbers are crucial.
4.4.1 The Density of Primes
Prime numbers, while infinite, become increasingly sparse as we consider larger integers. Their distribution is a fascinating and complex area of number theory. While there’s no simple formula to predict exactly where the next prime will occur, the Prime Number Theorem provides an asymptotic approximation of their density.
The Prime Number Theorem:
The Prime Number Theorem states that the number of primes less than or equal to , denoted by , is approximately for large . More precisely:
This means that the probability that a randomly chosen large number is prime decreases as the number increases, although infinitely many prime numbers exist. This theorem is crucial for understanding the probability of finding a large prime for cryptographic applications. There are many other, more refined approximations for available, some of which are quite accurate even for relatively small values of .
Example 4.7:
The largest gap between two consecutive prime numbers below 100 is 8. These primes are 89 and 97. That is, the interval contains no primes.
4.4.2 Remarks on Primality Testing
Primality testing is the problem of determining whether a given integer is prime. While simple trial division can decide whether a number is prime, it’s highly inefficient for large numbers.
Efficient Primality Testing Algorithms:
Fortunately, sophisticated and efficient primality testing algorithms exist, particularly for determining whether a given number is composite (not prime). These algorithms are used extensively in areas like cryptography.
Probabilistic Primality Testing:
Probabilistic algorithms offer a tradeoff between speed and certainty. They don’t guarantee correctness but give high probability (with tunable accuracy) results.
Deterministic Primality Testing:
Deterministic algorithms guarantee a correct answer but may be slower than probabilistic ones. A notable result in this area was the proof that primality testing is in the complexity class P; this means there exist algorithms with polynomial runtime, making primality testing computationally feasible for arbitrarily large integers.
The Importance of Primality Testing for Cryptography:
Cryptography heavily relies on the difficulty of factoring large numbers and the relative ease of finding large primes. Cryptographic systems often involve generating large prime numbers, then relying on the computational infeasibility of factoring their product. Therefore, primality testing algorithms are a crucial part of cryptographic systems’ security.
Additional Points:
-
The density of primes is a subject of ongoing mathematical research ; more precise and accurate approximations of are constantly being developed.
-
Sophisticated primality testing algorithms often leverage probabilistic methods to speed up the testing process, particularly for very large numbers. These algorithms don’t guarantee primality but offer very high probability of being correct.
-
Finding large primes efficiently is itself a complex computational problem crucial to many cryptographic systems ; generating provably prime numbers using deterministic algorithms requires more computational effort than probabilistic methods.
4.5 Congruences and Modular Arithmetic
TLDR: This chapter introduces modular arithmetic, a system where we work with remainders after division. Key concepts include modular congruences, modular arithmetic operations, multiplicative inverses, and the powerful Chinese Remainder Theorem.
4.5.1 Modular Congruences
Definition:
Two integers and are congruent modulo (where is a positive integer), denoted , if and only if divides . In other words, if and only if for some integer .
Examples:
-
Example 4.10: because , and .
-
Example 4.10: because , and .
-
Example 4.12: Consider . Is even or odd? We can determine this without computing directly:
- and are odd; their product is odd.
- is even and is odd; their product is even.
- The difference between an odd number and an even number is odd. Therefore, is odd. Note that we used modular arithmetic () implicitly.
Properties of Modular Congruence:
Modular congruence is an equivalence relation, satisfying:
- Reflexive: for all . (Any number is congruent to itself.)
- Symmetric: If , then . (If is congruent to , then is congruent to .)
- Transitive: If and , then . (If is congruent to , and is congruent to , then is congruent to .)
This is proven in Lemma 4.13 which requires showing that the definition of congruence modulo m satisfies the definition of an equivalence relation.
Lemma 4.13: Modular Congruence is an Equivalence Relation
Statement: For any positive integer , the relation is an equivalence relation on the set of integers .
Proof: To prove that is an equivalence relation, we must show it satisfies the three properties of an equivalence relation: reflexivity, symmetry, and transitivity.
-
Reflexivity: We need to show that for all integers . This is trivially true since , and for any .
-
Symmetry: We need to show that if , then . If , then for some integer . This means , so , which implies .
-
Transitivity: We need to show that if and , then . If and , then and for some integers and . Adding these equations gives: . Therefore, , so .
Since the relation satisfies reflexivity, symmetry, and transitivity, it’s an equivalence relation.
Lemma 4.14: Compatibility of Modular Congruence with Arithmetic Operations
Statement: If and , then:
Proof:
-
Addition: Since , we can write for some integer . Similarly, for some integer . Adding these equations: . This shows , thus .
-
Multiplication: Using the same expressions for and from above, we have: . This demonstrates that , thus .
Corollary 4.15: Modular Arithmetic with Polynomials
Statement: Let be a multivariate polynomial with integer coefficients. If for all , then .
Proof: The proof follows directly from Lemma 4.14. A polynomial is built up from addition and multiplication; because modular congruence preserves both addition and multiplication (Lemma 4.14), the congruence must hold for the entire polynomial.
These lemmas and the corollary formally demonstrate that modular arithmetic behaves predictably with the standard arithmetic operations. This is fundamental to many applications of modular arithmetic in computer science.
4.5.2 Modular Arithmetic
Definition:
Modular arithmetic is a system of arithmetic performed on the set of integers modulo , denoted , where is a positive integer. is typically represented as the set of remainders when integers are divided by : . Arithmetic operations (addition, subtraction, multiplication) are performed, and the result is then reduced modulo (taking the remainder after division by ).
Examples:
-
Example 4.13: Compute . We have . Therefore, .
-
Example 4.14: Using modular arithmetic to check calculations. Let’s verify using modulo 9:
- .
- .
- .
- .
- The remainders match, suggesting the calculation is correct (though not guaranteeing it). This is a probabilistic check, not a proof.
Lemma 4.16: Connection Between Modular Congruence and Remainders
For any integers with :
(i) (ii)
Proof:
(i) By definition, is the remainder when is divided by . This means for some integer . Then , which means , so .
(ii) : If , then . Since and for integers , we have , so . Because both remainders are in , their difference must also be divisible by , which implies .
: If , then and gives us , implying . Hence, .
Corollary 4.17: Modular Arithmetic with Polynomials
Let be a multivariate polynomial with integer coefficients and . Then:
Proof:
This follows directly from Lemma 4.14 and Lemma 4.16. Since polynomial evaluation involves only addition and multiplication, the congruence modulo is preserved at each step, reducing the complexity of the calculation.
4.5.3 Multiplicative Inverses
Definition:
The multiplicative inverse of an integer modulo , denoted , is an integer such that .
Existence:
A multiplicative inverse exists if and only if (Lemma 4.18).
Proof (of Lemma 4.18):
-
: If has a solution, then there exists an integer such that . Any common divisor of and would have to divide 1, hence .
-
: If , then by Corollary 4.5, there exist integers and such that . This implies . Therefore, is a solution. Uniqueness is proven by considering another potential solution and showing it must be congruent to modulo .
Example:
- Example 4.17: The multiplicative inverse of 5 modulo 13 is 8 since .
4.5.4 The Chinese Remainder Theorem
The Chinese Remainder Theorem (CRT) provides a way to solve systems of simultaneous congruences when the moduli are pairwise relatively prime.
Theorem 4.19 (Chinese Remainder Theorem):
Let be pairwise relatively prime positive integers (meaning for all ), and let . For any integers such that for all , there exists a unique solution , with , to the system of congruences:
The Chinese Remainder Theorem (CRT) solves systems of simultaneous congruences where the moduli are pairwise relatively prime. Let’s break down the theorem and its proof step-by-step:
Proof:
The proof is constructive; it shows how to build the solution and then proves its uniqueness.
1. Construction of a Solution:
-
(a) Define : For each , let . This represents the product of all moduli except .
-
(b) Find Multiplicative Inverses : Since for all , we have . This ensures that has a multiplicative inverse modulo . For each , find an integer such that . This can be done efficiently using the Extended Euclidean Algorithm.
-
(c) Construct the Solution: The solution is given by:
This formula is the core of the CRT. Each term in the sum contributes to the congruence modulo a specific .
2. Verification (Showing the constructed is a solution):
We need to show that the constructed in step 1 satisfies all the given congruences. Let’s consider the congruence modulo for an arbitrary :
This congruence holds because for all , contains as a factor, so . Therefore, only the term remains in the sum. Since (by construction), we have . This confirms that the constructed satisfies all the congruences.
3. Uniqueness of the Solution:
Let’s assume there are two solutions, and , both satisfying and the system of congruences. Then:
and for all .
This means that for all . Because the are pairwise relatively prime, their least common multiple is their product . Thus, , which means . Since both and are in the range , this implies . This proves the uniqueness of the solution.
Examples:
Example 4.18: Find such that
Find such that:
- , ,
- Find :
- (because )
Verification:
The solution is unique in the range .
Example 4.19: Evaluate
Compute . We can compute this modulo 5 and modulo 7 separately.
Since , .
Since , .
Using the Chinese Remainder Theorem with and , we find because 16 is the unique integer in such that and . Therefore, .
Example: Find such that
- , ,
Verify:
4.6 Application: Diffie-Hellman Key-Agreement
TLDR: The Diffie-Hellman key exchange is a cryptographic protocol enabling two parties to securely establish a shared secret key over an insecure channel, leveraging modular arithmetic and the computational difficulty of the discrete logarithm problem.
The Diffie-Hellman key agreement is a revolutionary cryptographic protocol that allows two parties (let’s call them Alice and Bob) to establish a shared secret key over an insecure channel, like the internet. Its security relies on the computational difficulty of the discrete logarithm problem.
The Protocol:
The protocol uses the following components:
-
A large prime number : This is publicly known.
-
A generator : An integer such that generates many values as ranges from 0 to (Technically, is a generator of the multiplicative group of integers modulo , denoted as .) This is also publicly known. This group is a cyclic group with order .
-
Alice’s secret key : A randomly chosen integer in the range . This is private to Alice.
-
Bob’s secret key : A randomly chosen integer in the range . This is private to Bob.
Steps:
-
Alice computes: . This is Alice’s public key.
-
Bob computes: . This is Bob’s public key.
-
Alice and Bob exchange their public keys: They send and to each other over the insecure channel.
-
Alice computes: . This is the shared secret key.
-
Bob computes: . This is also the shared secret key.
Proof of Key Agreement:
The magic of Diffie-Hellman is that and are identical, even though the calculation of the shared secret uses the private keys only locally, on each side. We show that :
.
.
Therefore, .
Security:
The security of Diffie-Hellman relies on the difficulty of solving the discrete logarithm problem—given , , and (or ), it’s computationally infeasible to find (or ) if the prime is sufficiently large. An eavesdropper can see the exchanged public keys ( and ), but calculating the shared secret key requires solving the discrete logarithm problem, which is computationally intractable.
Mechanical Analogy:
Imagine two padlocks. Alice and Bob each have a padlock with a unique key. They send their locked padlocks to each other, each person keeping their key secret. Alice uses Bob’s lock to secure a shared box. Bob uses Alice’s lock to secure the same shared box, using his own private key. An eavesdropper can observe the padlocks (public keys), but without the corresponding keys, cannot open the box (access the shared secret).