Cryptography Lecture 19.

Slides:



Advertisements
Similar presentations
1 Lect. 12: Number Theory. Contents Prime and Relative Prime Numbers Modular Arithmetic Fermat’s and Euler’s Theorem Extended Euclid’s Algorithm.
Advertisements

Cryptography and Network Security
Chapter 4 – Finite Fields. Introduction will now introduce finite fields of increasing importance in cryptography –AES, Elliptic Curve, IDEA, Public Key.
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Foundations of Network and Computer Security J J ohn Black Lecture #10 Sep 18 th 2009 CSCI 6268/TLEN 5550, Fall 2009.
CNS2010handout 8 :: introduction to number theory1 computer and network security matt barrie.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Introduction Polynomials
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
Great Theoretical Ideas in Computer Science.

Great Theoretical Ideas in Computer Science.
1 Properties of Integers Objectives At the end of this unit, students should be able to: State the division algorithm Apply the division algorithm Find.
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
CPSC 3730 Cryptography and Network Security
1 Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown Chapter 4 – Finite Fields.
Information Security and Management 4. Finite Fields 8
Numbers, Operations, and Quantitative Reasoning.
Prelude to Public-Key Cryptography Rocky K. C. Chang, February
Chapter 4 – Finite Fields
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Scott CH Huang COM5336 Cryptography Lecture 11 Euclidean Domains & Division Algorithm Scott CH Huang COM 5336 Cryptography Lecture 10.
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Foundations of Discrete Mathematics Chapter 4 By Dr. Dalia M. Gil, Ph.D.
MA/CSSE 473 Day 08 Extended Euclid's Algorithm Modular Division Fermat's little theorem.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Modular Arithmetic and the RSA Cryptosystem Great Theoretical Ideas In Computer Science John LaffertyCS Fall 2005 Lecture 9Sept 27, 2005Carnegie.
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
15-499Page :Algorithms and Applications Cryptography II – Number theory (groups and fields)
Cryptography and Network Security Chapter 4 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Great Theoretical Ideas In Computer Science COMPSCI 102 Fall 2010 Lecture 16October 27, 2010Duke University Modular Arithmetic and the RSA Cryptosystem.
Great Theoretical Ideas in Computer Science.
Cryptography Lecture 14 Arpita Patra © Arpita Patra.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Great Theoretical Ideas in Computer Science.
Math 3121 Abstract Algebra I
Assignment 4 is due! Assignment 5 is out and is due in two weeks!
Modular Arithmetic and the RSA Cryptosystem
CS480 Cryptography and Information Security
Topic 12: Number Theory Basics (2)
Great Theoretical Ideas in Computer Science
Advanced Algorithms Analysis and Design
Lecture 3.2: Public Key Cryptography II
Numerical Algorithms x x-1 Numerical Algorithms
B504/I538: Introduction to Cryptography
MATH301- DISCRETE MATHEMATICS Copyright © Nahid Sultana Dr. Nahid Sultana Chapter 4: Number Theory and Cryptography.
Number Theory and Modular Arithmetic
Cryptography Lecture 22.
Computer Security Modular Arithmetic November 12, 2018
Great Theoretical Ideas in Computer Science
Foundations of Discrete Mathematics
Lecture 20 Guest lecturer: Neal Gupta
Cryptography Lecture 21.
刘振 上海交通大学 计算机科学与工程系 电信群楼3-509
Modular Arithmetic and the RSA Cryptosystem
Great Theoretical Ideas in Computer Science
Lecture 3.1: Public Key Cryptography I
Great Theoretical Ideas in Computer Science
Algebraic Structures: Group Theory
Mathematical Background for Cryptography
Clements MAΘ October 30th, 2014
Cryptography Lecture 18.
Cryptography Lecture 17.
Cryptography Lecture 20.
Cryptography Lecture 16.
Cryptography Lecture 21.
296.3:Algorithms in the Real World
Mathematical Background : A quick approach to Group and Field Theory
Presentation transcript:

Cryptography Lecture 19

Exponentiation Compute ab ? Instead, look at modular exponentiation ǁabǁ = O(b · ǁaǁ) Just writing down the answer takes exponential time! Instead, look at modular exponentiation I.e., compute [ab mod N] Size of the answer < ǁNǁ How to do it? Computing ab and then reducing modulo N will not work…

Modular exponentiation Consider the following algorithm: exp(a, b, N) { // assume b  0 ans = 1; for (i=1, i ≤ b; i++) ans = [ans * a mod N]; return ans; } This runs in time O(b * poly(ǁaǁ, ǁNǁ)) This is an exponential-time algorithm!

Efficient modular exponentiation Assume b = 2k for simplicity The preceding algorithm roughly corresponds to computing a*a*a*…*a Better: compute (((a2)2)2…)2 2k multiplications vs. k squarings Note k = O(ǁbǁ)

Efficient exponentiation Consider the following algorithm: exp(a, b, N) { // assume b  0 x=a, t=1; while (b>0) { if (b odd) t = [t * x mod N], b = b-1; x = [x2 mod N], b = b/2; } return t; } Why does this work? Invariant: answer is [t xb mod N] Running time is polynomial in ǁaǁ, ǁbǁ, ǁNǁ

Primes and divisibility Assume you have encountered this before… Notation a | b If a | b then a is a divisor of b p > 1 is prime if its only divisors are 1 and p p is composite otherwise d = gcd(a, b) if both: d | a and d | b d is the largest integer with that property

Computing gcd? Can compute gcd(a, b) by factoring a and b and looking for common prime factors… This is not (known to be) efficient! Use Euclidean algorithm to compute gcd(a, b) One of the earliest nontrivial algorithms!

Euclidean algorithm

Proposition Given a, b > 0, there exist integers X, Y such that Xa + Yb = gcd(a, b) Moreover, d=gcd(a, b) is the smallest positive integer that can be written this way See book for proof Can use the extended Euclidean algorithm to compute X, Y See book for details

Modular inverses b is invertible modulo N if there exists an integer a such that ab = 1 mod N Let [b-1 mod N] denote the unique such a that lies in the range {0, …, N-1} Division by b modulo N is only defined when b is invertible modulo N In that case, [c/b mod N] defined as [c b-1 mod N]

Cancellation The “expected” cancellation rule applies for invertible elements I.e., if ab = cb mod N and b is invertible modulo N, then a = c mod N Proof: multiply both sides by b-1 Note: this is not true if b is not invertible E.g., 3*2 = 15*2 mod 8 but 3  15 mod 8

Invertibility How to determine whether b is invertible modulo N? Thm: b invertible modulo N iff gcd(b, N)=1 To find the inverse, use extended Euclidean algorithm to find X, Y with Xb + YN = 1 Then [X mod N] is the inverse of b modulo N Conclusion: can efficiently test invertibility and compute inverses!

Group theory

Groups Introduce the notion of a group Provides a way of reasoning about objects that share the same mathematical structure Not absolutely needed to understand crypto applications, but does make it conceptually easier

Groups An abelian group is a set G and a binary operation ◦ defined on G such that: (Closure) For all g, hG, g◦h is in G There is an identity eG such that e◦g=g for gG Every gG has an inverse hG such that h◦g = e (Associativity) For all f, g, hG, f◦(g◦h) = (f◦g)◦h (Commutativity) For all g, hG, g◦h = h◦g The order of a finite group G is the number of elements in G

Examples ℤ under addition ℤ under multiplication ℝ under addition {0,1}* under concatenation {0, 1}n under bitwise XOR 2 x 2 invertible, real matrices under mult.

Groups The group operation can be written additively or multiplicatively I.e., instead of g◦h, write g+h or gh Does not mean that the group operation has anything to do with (integer) addition or multiplication Identity denoted by 0 or 1, respectively Inverse of g denoted by –g or g-1, respectively Group exponentiation: m · a or am, respectively

Computations in groups When computing with groups, need to fix some representation of the group elements Must fix some representation for group elements Usually (but not always) some canonical representation Usually want a unique representation for each element Must be possible to efficiently identify elements in the group Must be possible to efficiently perform the group operation  Group exponentiation can be computed efficiently

Useful example ℤN = {0, …, N-1} under addition modulo N Identity is 0 Inverse of a is [-a mod N] Associativity, commutativity obvious Order N

Example What happens if we consider multiplication modulo N? {0, …, N-1} is not a group under this operation! 0 has no inverse Even if we exclude 0, there is, e.g., no inverse of 2 modulo 4

Example Consider instead the invertible elements modulo N, under multiplication modulo N I.e., ℤ*N = {0 < x < N : gcd(x, N) = 1} Closure Identity is 1 Inverse of a is [a-1 mod N] Associativity, commutativity obvious

(N) (N) = the number of invertible elements modulo N = |{a  {1, …, N-1} : gcd(a, N) = 1}| = The order of ℤ*N

Two special cases If p is prime, then 1, 2, 3, …, p-1 are all invertible modulo p (p) = |ℤ*p| = p-1 If N=pq for p, q distinct primes, then the invertible elements are the integers from 1 to N-1 that are not multiples of p or q (N) = |ℤ*N| = ?

Fermat’s little theorem Let G be a finite group of order m. Then for any g  G, it holds that gm = 1 Proof (abelian case)

Examples In ℤN : In ℤ*N : For all aℤN, we have N · a = 0 mod N (Note that N is not in the group!) In ℤ*N : For all aℤ*N, we have a(N) = 1 mod N p prime: for all a  ℤ*p, we have ap-1 = 1 mod p