CSC 474 Information Systems Security

Similar documents
CSC 474 Network Security. Outline. GCD and Euclid s Algorithm. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

CIS 6930/4930 Computer and Network Security. Topic 5.1 Basic Number Theory -- Foundation of Public Key Cryptography

Outline. Some Review: Divisors. Common Divisors. Primes and Factors. b divides a (or b is a divisor of a) if a = mb for some m

Outline. AIT 682: Network and Systems Security. GCD and Euclid s Algorithm Modulo Arithmetic Modular Exponentiation Discrete Logarithms

Number Theory. CSS322: Security and Cryptography. Sirindhorn International Institute of Technology Thammasat University CSS322. Number Theory.

Chapter 9 Basic Number Theory for Public Key Cryptography. WANG YANG

2.3 In modular arithmetic, all arithmetic operations are performed modulo some integer.

Number Theory. Modular Arithmetic

Chapter 8. Introduction to Number Theory

Topics in Cryptography. Lecture 5: Basic Number Theory

Number Theory and Group Theoryfor Public-Key Cryptography

Introduction to Information Security

Mathematical Foundations of Cryptography

Finite Fields. Mike Reiter

Basic elements of number theory

Basic elements of number theory

Public Key Encryption

Numbers. Çetin Kaya Koç Winter / 18

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

CPSC 467: Cryptography and Computer Security

Lecture 4: Number theory

NUMBER THEORY. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA

CPSC 467b: Cryptography and Computer Security

CMPUT 403: Number Theory

Chapter 4 Finite Fields

Introduction to Cryptography. Lecture 6

The Euclidean Algorithm and Multiplicative Inverses

Number Theory & Modern Cryptography

This is a recursive algorithm. The procedure is guaranteed to terminate, since the second argument decreases each time.

CS 5319 Advanced Discrete Structure. Lecture 9: Introduction to Number Theory II

Q 2.0.2: If it s 5:30pm now, what time will it be in 4753 hours? Q 2.0.3: Today is Wednesday. What day of the week will it be in one year from today?

Introduction to Number Theory 1. c Eli Biham - December 13, Introduction to Number Theory 1

Number Theory Notes Spring 2011

Number Theory Proof Portfolio

Outline. Number Theory and Modular Arithmetic. p-1. Definition: Modular equivalence a b [mod n] (a mod n) = (b mod n) n (a-b)

Introduction to Public-Key Cryptosystems:

Number Theory and Algebra: A Brief Introduction

Modular Arithmetic. Examples: 17 mod 5 = 2. 5 mod 17 = 5. 8 mod 3 = 1. Some interesting properties of modular arithmetic:

ECE 646 Lecture 5. Mathematical Background: Modular Arithmetic

Number Theory. Zachary Friggstad. Programming Club Meeting

Lecture 3.1: Public Key Cryptography I

8 Primes and Modular Arithmetic

The set of integers will be denoted by Z = {, -3, -2, -1, 0, 1, 2, 3, 4, }

Elementary Number Theory MARUCO. Summer, 2018

Lecture notes: Algorithms for integers, polynomials (Thorsten Theobald)

Ch 4.2 Divisibility Properties

Know the Well-ordering principle: Any set of positive integers which has at least one element contains a smallest element.

Number Theory. Raj Jain. Washington University in St. Louis

2. THE EUCLIDEAN ALGORITHM More ring essentials

cse 311: foundations of computing Spring 2015 Lecture 12: Primes, GCD, applications

Number Theory Alex X. Liu & Haipeng Dai

CIS 551 / TCOM 401 Computer and Network Security

Chapter 9 Mathematics of Cryptography Part III: Primes and Related Congruence Equations

SOLUTIONS Math 345 Homework 6 10/11/2017. Exercise 23. (a) Solve the following congruences: (i) x (mod 12) Answer. We have

CSE20: Discrete Mathematics

LECTURE NOTES IN CRYPTOGRAPHY

4 Powers of an Element; Cyclic Groups

Theory of Numbers Problems

COMS W4995 Introduction to Cryptography September 29, Lecture 8: Number Theory

ECEN 5022 Cryptography

MATH 4400 SOLUTIONS TO SOME EXERCISES. 1. Chapter 1

ALG 4.0 Number Theory Algorithms:

Mathematics for Cryptography

Senior Math Circles Cryptography and Number Theory Week 2

Biomedical Security. Some Security News 9/17/2018. Erwin M. Bakker. Blockchains are not safe for voting (slashdot.org) : From: paragonie.

NOTES ON SIMPLE NUMBER THEORY

[Part 2] Asymmetric-Key Encipherment. Chapter 9. Mathematics of Cryptography. Objectives. Contents. Objectives

Public-key Cryptography: Theory and Practice

Integers and Division

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

MTH 346: The Chinese Remainder Theorem

Number Theory A focused introduction

MATH 361: NUMBER THEORY FOURTH LECTURE

A Few Primality Testing Algorithms

4 Number Theory and Cryptography

CSc 466/566. Computer Security. 5 : Cryptography Basics

COMP239: Mathematics for Computer Science II. Prof. Chadi Assi EV7.635

3 The fundamentals: Algorithms, the integers, and matrices

MATH 433 Applied Algebra Lecture 4: Modular arithmetic (continued). Linear congruences.

Elementary Number Theory Review. Franz Luef

Chapter 8 Public-key Cryptography and Digital Signatures

Homework #2 solutions Due: June 15, 2012

Elementary Algebra Chinese Remainder Theorem Euclidean Algorithm

Math 324, Fall 2011 Assignment 7 Solutions. 1 (ab) γ = a γ b γ mod n.

1 Overview and revision

Lecture Notes, Week 6

Chapter 5. Modular arithmetic. 5.1 The modular ring

Notes on Primitive Roots Dan Klain

Arithmetic Algorithms, Part 1

Discrete Logarithms. Let s begin by recalling the definitions and a theorem. Let m be a given modulus. Then the finite set

CS250: Discrete Math for Computer Science

Applied Cryptography and Computer Security CSE 664 Spring 2018

cse 311: foundations of computing Fall 2015 Lecture 12: Primes, GCD, applications

10 Problem 1. The following assertions may be true or false, depending on the choice of the integers a, b 0. a "

Lecture 14: Hardness Assumptions

Congruences and Residue Class Rings

CPE 776:DATA SECURITY & CRYPTOGRAPHY. Some Number Theory and Classical Crypto Systems

Basic Algorithms in Number Theory

Some Facts from Number Theory

Transcription:

CSC Information Systems Security Topic. Basic Number Theory CSC Dr. Peng Ning Basic Number Theory We are talking about integers! Divisor We say that b divides a if a = mb for some m, denoted b a. b is a divisor of a. If a, then a = or. If a b and b a, then a = b or b. Any b divides. If b g and b h, then b (mg+nh) for arbitrary integers m and n. CSC Dr. Peng Ning

Basic Number Theory (Cont d) Prime numbers An integer p > is a prime number if its only divisors are,, p, and p. Examples:,,,,,,,,, Any integer a > can be factored in a unique a way as a = p a p a...p t t where each p >p > >p t are prime numbers and where each a i >. Examples: =, =. CSC Dr. Peng Ning Basic Number Theory (Cont d) Another view of a b: Let P be the set of all prime numbers Represent a as Represent b as a b means that a i b i. a = " p #P p a p, where a p $. b = " p #P p b p, where b p $. CSC Dr. Peng Ning

Basic Number Theory (Cont d) Greatest common divisor: gcd(a,b) gcd(a,b) =max{k k a and k b} Examples gcd(,)=. gcd(,)=gcd(,-)=. gcd(a,) = a. gcd(a,b) can be easily derived if we can factor a and b. Relatively Prime Numbers Integers a and b are relatively prime if gcd(a,b) =. Example: 8 and are relatively prime. CSC Dr. Peng Ning Modulo Operator Given any positive integer n and any integer a, we have a = qn+r, where r<n and q= a/n. We write r = a mod n. The remainder r is often referred to as a residue. Example: = mod. Two integer a and b are said to be congruent modulo n if a mod n = b mod n. We write a b mod n Example: mod. CSC Dr. Peng Ning

Modulo Operator (Cont d) Properties of modulo operator a b mod n if n (a b) (a mod n) = (b mod n) implies a b mod n. a b mod n implies b a mod n. a b mod n and b c mod n imply a c mod n. CSC Dr. Peng Ning Modular Arithmetic Observation: The (mod n) operator maps all integers into the set of integers{,,,, (n-)}. Modular addition. [(a mod n) + (b mod n)] mod n = (a+b) mod n Modular subtraction. [(a mod n) (b mod n)] mod n = (a b) mod n Modular multiplication. [(a mod n) (b mod n)] mod n = (a b) mod n CSC Dr. Peng Ning 8

An Exercise (n=) Addition Multiplication Exponentiation mod = CSC Dr. Peng Ning Properties of Modular Arithmetic Z n ={,,, (n-)} Commutative laws (w + x) mod n = (x + w) mod n (w x) mod n = (x w) mod n Associative laws [(w + x) + y] mod n = [w + (x + y)] mod n [(w x) y] mod n = [w (x y)] mod n Distributive law [w (x + y)] mod n = [(w x)+(w y)] mod n Identities ( + w) mod n = w mod n ( w) mod n = w mod n Additive inverse ( w) For each w Z n, there exists a z such that w + z= mod n. CSC Dr. Peng Ning

About Multiplicative Inverse Not always exist Example: There doesn t exist a z such that z = mod 8. Z 8 Residues An integer a Z n has a multiplicative inverse if gcd(a, n) =. In particular, if n is a prime number, then all elements in Z n have multiplicative inverse. 8 CSC Dr. Peng Ning Fermat s Theorem If p is prime and a is a positive integer not divisible by p, then a p- mod p. Observation: {a mod p, a mod p,, (p-)a mod p} = {,,, (p-)}. a a.. (p-)a [(a mod p) (a mod p) ((p-)a mod p)] mod p (p-)! a p- (p-)! mod p Thus, a p- mod p. CSC Dr. Peng Ning

Totient Function Totient function ø(n): number of integers less than n and relatively prime to n If n is prime, ø(n)=n- If n=p q, and p, q are primes, ø(n)=(p-)(q-) Examples: ø()= ø()= CSC Dr. Peng Ning Euler s Theorem For every a and n that are relatively prime, a ø(n) mod n. Proof leaves as an exercise. Examples a=, n=, ø()=, ø() mod = a=, n=, ø()=, ø() mod =. CSC Dr. Peng Ning

Modular Exponentiation x y mod n = x y mod ø(n) mod n if y = mod ø(n) then x y mod n = x mod n Example: mod = CSC Dr. Peng Ning Euclid s Algorithm Observation gcd(a, b) = gcd(b, a mod b) Eulid (d, f), d > f >.. X d; Y f. If Y = return X=gcd(d, f). R = X mod Y. X Y. Y R. Goto CSC Dr. Peng Ning

Extended Euclid Algorithm Extended Euclid (d, f). (X, X, X) (,,f); (Y, Y, Y) (,,d). If Y= return X=gcd (d, f); no inverse. If Y= return Y=gcd (d, f); Y=d mod f. Q= X/Y. (T, T, T) (X QY, X QY, X QY). (X, X, X) (Y, Y, Y). (Y, Y, Y) (T, T, T) 8. Goto Observation fx + dx = X; fy + dy = Y If Y =, then fy + dy = Y = d mod f CSC Dr. Peng Ning The Power of An Integer Modulo n Consider the following expression a m mod n If a and n are relatively prime, then there is at least one integer m that satisfies the above equation. That is, the Euler s totient function φ(n). The least positive exponent m for which the above equation holds is referred to as: The order of a (mod n) The exponent to which a belongs (mod n) The length of the period generated by a. CSC Dr. Peng Ning 8

Understanding The Order of a (mod n) Powers of Integers Modulo a a a a a a a a 8 a a a a a a a a a a 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 CSC Dr. Peng Ning Observations in The Previous Table All sequences end in. The length of a sequence divides φ() = 8. Lengths:,,,,, 8. Some of the sequences are of length 8. The base integer a generates (via powers) all nonzero integers modulo. CSC Dr. Peng Ning

Primitive Root The highest possible order of a (mod n) is φ(n). Primitive root If the order of a (mod n) is φ(n), then a is referred to as a primitive root of n. The powers of a: a, a,, a n- are distinct (mod n) and are all relatively prime to n. For a prime number p, if a is a primitive root of p, then a, a,, a p- are all the distinct numbers mod p. CSC Dr. Peng Ning Discrete Logarithm Given a primitive root a for a prime number p: The expression b a i mod p, i (p-), produces the integers from to (p-). The exponent i is referred to as the index of b for the base a (mod p), denoted as ind a,p (b). ind a,p ()=, because a mod p =. ind a,p (a)=, because a mod p = a. Example: Integer is a primitive root of prime number Number 8 Index 8 Number 8 Index CSC Dr. Peng Ning

Discrete Logarithm (Cont d) Consider x=a ind a,p(x) mod p, y=a ind a,p(y) mod p, and xy=a ind a,p(xy) mod p, a ind a,p(xy) mod p = (a ind a,p(x) mod p)(a ind a,p(y) mod p) a ind a,p(xy) mod p = (a ind a,p(x)+inda,p(y) ) mod p By Euler s theorem: a z a q mod p iff z q mod φ(p). ind a,p (xy) = ind a,p (x)+ind a,p (y) mod φ(p). ind a,p (y r ) = [r ind a,p (y)] mod φ(p). Discrete logarithm mod p: index mod p. Computing a discrete logarithm mod a large prime number p is in general difficult Used as the basis of some public key cryptosystems. CSC Dr. Peng Ning