0% found this document useful (0 votes)
3 views15 pages

Lecture Slides 5

The document covers key concepts in number theory, focusing on primes, modular arithmetic, and their applications in information security. It explains divisibility, prime numbers, modular operations, and important theorems such as Fermat's and Euler's theorems. Additionally, it discusses the complexity of certain computational problems related to integer factorization and discrete logarithms.

Uploaded by

esha46065
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views15 pages

Lecture Slides 5

The document covers key concepts in number theory, focusing on primes, modular arithmetic, and their applications in information security. It explains divisibility, prime numbers, modular operations, and important theorems such as Fermat's and Euler's theorems. Additionally, it discusses the complexity of certain computational problems related to integer factorization and discrete logarithms.

Uploaded by

esha46065
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

Number Theory

Primes

Modular
Arithmetic
Number Theory

Information Security

1/15
Contents
Number Theory

Primes

Modular
Arithmetic

Divisibility and Prime Numbers

Modular Arithmetic

2/15
Divisibility
Number Theory
I b divides a if a = mb for some m, where a, b and m are
Primes
integers
Modular
Arithmetic I b|a
I b is a divisor of a
I gcd(a, b): greatest common divisor of a and b
I Euclidean algorithm can find gcd
I Two integers, a and b, are relatively prime if
gcd(a, b) = 1

3/15
Prime Numbers
Number Theory

Primes
I An integer p > 1 is a prime number if and only if its
Modular
only divisors are ±1 and ±p
Arithmetic
I Any integer a > 1 can be factored as:

a = p2a1 × p2a2 × · · · × ptat

where p1 < p2 < . . . < pt are prime numbers and where


each ai is a positive integer

4/15
Primes Under 2000
Number Theory

Primes

Modular
Arithmetic

5/15
Contents
Number Theory

Primes

Modular
Arithmetic

Divisibility and Prime Numbers

Modular Arithmetic

6/15
Modular Arithmetic
Number Theory

Primes
I If a is an integer and n is a positive integer, we define
Modular
a mod n to be the remainder when a is divided by n
Arithmetic
I n is called the modulus
I Two integers a and b are congruent modulo n if
(a mod n) = (b mod n), which is written as

a≡b (mod n)

I (mod n) operator maps all integers into the set of


integers Zn = {0, 1, . . . , (n − 1)}
I Modular arithmetic performs arithmetic operations
within confines of set Zn

7/15
Properties of Modular Arithmetic
Number Theory

Primes
I Rules of ordinary arithmetic involving addition,
Modular
subtraction, and multiplication also apply in modular
Arithmetic arithmetic
[(a mod n) + (b mod n)] mod n = (a + b) mod n
[(a mod n) − (b mod n)] mod n = (a − b) mod n
[(a mod n) × (b mod n)] mod n = (a × b) mod n

8/15
Division in Modular Arithmetic
Number Theory
I a is additive inverse of b if a + b ≡ 0 (mod n)
Primes
I All integers have an additive inverse
Modular
Arithmetic I a is multiplicative inverse of b if a × b ≡ 1 (mod n)
I Not all integers have a multiplicative inverse
I a has a multiplicative inverse in (mod n) if a is
relatively prime to n
I Division: a ÷ b ≡ a × MultInverse(b) (mod n)

9/15
Fermat’s Theorem
Number Theory

Primes
I Fermat’s Theorem (1): if p is prime and a is a positive
Modular
integer not divisible by p, then
Arithmetic

ap−1 ≡ 1 (mod p)

I Fermat’s Theorem (2): if p is prime and a is a positive


integer, then
ap ≡ a (mod p)

10/15
Euler’s Theorem
Number Theory
I Euler’s Totient Function, φ(n): the number of positive
Primes
integers less than n and relatively prime to n
Modular
Arithmetic I φ(1) = 1
I For prime p, φ(p) = p − 1
I For primes p and q, and n = pq,
φ(n) = (p − 1) × (q − 1)
I Euler’s Theorem (1): For every a and n that are
relatively prime:

aφ(n) ≡ 1 (mod n)

I Euler’s Theorem (2): For positive integers a and n:

aφ(n)+1 ≡ a (mod n)

11/15
Logarithms in Modular Arithmetic
Number Theory

Primes
I Exponentiation (mod n): repeated multiplication
Modular I Logarithms in ordinary arithmetic:
Arithmetic

b = ai

i = loga (b)
I Logarithms in modular arithmetic (discrete logarithm):

b = ai (mod p)

i = dloga,p (b)
I A unique exponent i can be found if a is a primitive
root of prime p
I If a is a primitive root of p then a, a2 , a3 , . . . , ap−1 are
distinct (modp)
I Only integers with primitive roots: 2, 4, p α , 2p α where
p is any odd prime and alpha is positive integer
12/15
Powers of Integers, Modulo 19
Number Theory

Primes

Modular
Arithmetic

Credit: Table 8.3 in Stallings, Cryptography and Network Security, 5th Ed., Pearson 2011

13/15
Discrete Logarithms, Modulo 19
Number Theory

Primes

Modular
Arithmetic

14/15 Credit: Table 8.4 in Stallings, Cryptography and Network Security, 5th Ed., Pearson 2011
Complexity
Number Theory

Primes
Certain problems are computationally hard . . .
Modular Integer Factorisation
Arithmetic

I If p and q are unknown primes, given n = pq, find p


and q
I Largest RSA number factored into two primes is 768
bits (232 decimal digits)

Euler’s Totient
I Given composite n, find φ(n)
I Harder than integer factorisation

Discrete Logarithms
I Given b, a and p, find i such that i = dloga,p (b)
I Comparable to integer factorisation
15/15

You might also like