I. Foundations of Number Theory
Number theory studies integers and their relationships. Its cryptographic importance comes from arithmetic operations that are easy to perform but, for suitably large numbers, difficult to reverse without secret information.
A. Governing Principles and Conventions
The unit depends on precise notation for integers, divisibility, remainders, and congruence.
- Integer domain: The symbol denotes all integers:
- Equality versus congruence: Equality means two integers have the same value; congruence means they have the same remainder under a specified modulus. Thus , but .
- Modulus convention: In , the modulus is normally positive. The least nonnegative residue belongs to .
- Cryptographic principle: Plaintext is encoded numerically, transformed using modular arithmetic and a key, and recovered by applying an inverse transformation.
- Closure: Integer addition, subtraction, and multiplication produce integers, allowing modular calculations to remain within a finite residue system.
II. Integer Relations
A. Divisibility and modular arithmetic
Divisibility describes exact integer multiplication, while modular arithmetic classifies integers according to their remainders.
- Divisibility: For , with , means that for some . For example, because .
- Non-divisibility: The notation means no integer satisfies ; for example, .
- Division algorithm: For integer and positive integer , unique integers exist such that:
Texta = mq + r, where 0 <= r < m
Here is the quotient and is the remainder. - Congruence: For integers and :
Texta ≡ b (mod m) exactly when m | (a - b)
Thus , since . - Arithmetic rules: If and , then:
Texta + c ≡ b + d (mod m) a - c ≡ b - d (mod m) ac ≡ bd (mod m) - Cancellation restriction: From , cancellation of is valid when . Division is therefore not automatically permitted.
III. Fundamental Integer Building Blocks
A. Primes
A prime is an integer greater than whose only positive divisors are and itself.
- Prime and composite numbers: The numbers are prime; is composite because . The integer is neither prime nor composite.
- Fundamental theorem of arithmetic: Every integer is either prime or has a factorization into primes that is unique apart from factor order.
- Example factorization:
Text360 = 2^3 × 3^2 × 5
The exponents give the multiplicities of the prime factors. - Testing principle: A composite has a prime divisor not exceeding . To test , it is sufficient to check divisibility by and .
- Cryptographic role: Systems such as RSA use products of large primes because multiplication is efficient while recovering the prime factors of a sufficiently large product is computationally difficult.
IV. Common Divisors and Multiples
A. Greatest common divisors and least common multiples
The greatest common divisor measures shared factors, while the least common multiple gives the smallest shared positive multiple.
- Greatest common divisor: is the greatest positive integer dividing both nonzero integers and .
- Coprimality: Integers and are relatively prime when ; for example, .
- Least common multiple: is the least positive integer divisible by both and .
- Product relation: For positive integers :
Textgcd(a,b) × lcm(a,b) = ab - Prime-exponent method: The gcd uses the minimum exponent of each shared prime, whereas the lcm uses the maximum exponent appearing in either number.
- Worked example: Since and ,
Textgcd(24,36) = 2^2 × 3 = 12 lcm(24,36) = 2^3 × 3^2 = 72
V. Efficient GCD Computation
A. Euclidean algorithm
The Euclidean algorithm repeatedly replaces a pair of integers by the divisor and remainder without changing their gcd.
- Core identity: If , then:
Textgcd(a,b) = gcd(b,r)
Here , , and . - Procedure: Divide the larger number by the smaller, replace the pair with the smaller number and nonzero remainder, and repeat. The last nonzero remainder is the gcd.
- Worked example:
Text252 = 105(2) + 42 105 = 42(2) + 21 42 = 21(2) + 0 gcd(252,105) = 21 - Efficiency: Remainders decrease strictly, so the algorithm terminates and avoids prime factorization.
- Extended form: Recording substitutions during the algorithm expresses the gcd as a linear combination of the original integers.
VI. Linear Combination of Integers
A. Bezout's lemma
Bezout's lemma states that the gcd of two integers can be expressed as an integer linear combination of them.
- Formal statement: For nonzero integers , there exist such that:
Textax + by = gcd(a,b)
The integers and are Bezout coefficients. - Coprime case: If , then some integers satisfy .
- Derivation by substitution: From the Euclidean calculation:
Text21 = 105 - 42(2) 42 = 252 - 105(2)
substitution gives:
Text21 = 105(5) - 252(2) - Solvability consequence: The equation has integer solutions exactly when .
- Cryptographic significance: Bezout coefficients calculate modular inverses, which are required for affine decryption and public-key algorithms.
VII. Modular Equations
A. Linear congruence
A linear congruence seeks integers satisfying .
- Equivalent equation: The congruence means , or:
Textax - my = b
for some integer . - Existence condition: Let . Solutions exist exactly when .
- Number of solutions: If , there are exactly incongruent solutions modulo .
- Reduction: Dividing , , and by produces a congruence whose coefficient and modulus are coprime.
- Worked example: For , , and . Reduction gives:
Text2x ≡ 3 (mod 5) x ≡ 4 (mod 5)
Hence modulo , the three solutions are .
VIII. Reversible Modular Multiplication
A. Inverse of a modulo m
A modular inverse of modulo is an integer that reverses multiplication by .
- Definition: An integer satisfies:
Textaa^(-1) ≡ 1 (mod m)
where . - Existence criterion: The inverse exists exactly when .
- Bezout connection: If , reduction modulo gives ; therefore, is an inverse of .
- Worked example: The Euclidean algorithm gives:
Text26 = 7(3) + 5 7 = 5(1) + 2 5 = 2(2) + 1
Back-substitution yields . Therefore,
Text7^(-1) ≡ -11 ≡ 15 (mod 26) - Uniqueness: When an inverse exists, it is unique modulo .
IX. Simultaneous Congruences
A. Chinese remainder theorem
The Chinese remainder theorem combines congruences with pairwise coprime moduli into one congruence.
- Formal statement: If are pairwise coprime positive integers, then:
Textx ≡ a_i (mod m_i), for i = 1,...,k
has a unique solution modulo . - Construction: Define , and choose satisfying . Then:
Textx ≡ Σ(a_i M_i y_i) (mod M) - Worked example: For and , . Using and :
Textx ≡ 2(5)(2) + 3(3)(2) ≡ 38 ≡ 8 (mod 15) - Application: CRT can replace one computation modulo a large composite number with several smaller computations, improving efficiency in cryptographic implementations.
- Limitation: Without pairwise coprime moduli, compatibility conditions are required and uniqueness is modulo the lcm rather than necessarily the product.
X. Classical Substitution Cryptography
A. Encryption and decryption by Caesar cipher and affine transformation
These ciphers encode letters as residues and use reversible modular functions to transform plaintext into ciphertext.
-
Caesar cipher: This cipher shifts every letter by a fixed key .
- Encoding: Assign , and use:
TextEncryption: E_k(x) = (x + k) mod 26 Decryption: D_k(y) = (y - k) mod 26
Here is plaintext, is ciphertext, and is the shift. - Example: With , becomes .
- Limitation: Only shifts exist, so exhaustive key search and frequency analysis defeat the cipher easily.
- Encoding: Assign , and use:
-
Affine transformation: This cipher combines multiplication and addition:
- Functions:
TextEncryption: E(x) = (ax + b) mod 26 Decryption: D(y) = a^(-1)(y - b) mod 26
Here is the key and is the inverse of modulo . - Key condition: Decryption is possible only when . Thus must be one of .
- Contrast: Caesar encryption is the affine case ; multiplication enlarges the affine key space but does not prevent frequency analysis.
- Functions:
XI. Prime-Modulus Exponentiation
A. Fermat's little theorem
Fermat's little theorem simplifies powers modulo a prime and provides a theoretical basis for modular inverses and cryptography.
- Formal statement: If is prime and , then:
Texta^(p-1) ≡ 1 (mod p)
Here and is prime. - Equivalent form: For every integer and prime :
Texta^p ≡ a (mod p) - Inverse consequence: If , multiplying as shows:
Texta^(-1) ≡ a^(p-2) (mod p) - Worked example: To find , use . Since :
Text3^100 ≡ (3^6)^16 × 3^4 ≡ 1 × 81 ≡ 4 (mod 7) - Primality limitation: Failure of proves that is composite, but passing this test alone does not guarantee that is prime.
Nearly through. Did unit 6 of MTH401 save you a night before the exam?
LPU Notes is free. A student pays for the servers.
Did unit 6 of MTH401 save you a night before the exam?
Then you can help keep it free for the next batch. Ads cover part of the server bill; the rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks.