Mathematical Foundations of Public-Key Cryptography

Similar documents
Carmen s Core Concepts (Math 135)

Introduction to Public-Key Cryptosystems:

Number Theory & Modern Cryptography

Number Theory and Algebra: A Brief Introduction

Mathematics of Cryptography

Lemma 1.2. (1) If p is prime, then ϕ(p) = p 1. (2) If p q are two primes, then ϕ(pq) = (p 1)(q 1).

Course 2BA1: Trinity 2006 Section 9: Introduction to Number Theory and Cryptography

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

ECE596C: Handout #11

Chapter 8 Public-key Cryptography and Digital Signatures

Slides by Kent Seamons and Tim van der Horst Last Updated: Oct 1, 2013

Number Theory and Group Theoryfor Public-Key Cryptography

The security of RSA (part 1) The security of RSA (part 1)

Lecture 3.1: Public Key Cryptography I

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

CPSC 467b: Cryptography and Computer Security

Overview. Background / Context. CSC 580 Cryptography and Computer Security. March 21, 2017

Iterated Encryption and Wiener s attack on RSA

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

Public Key Cryptography

Topics in Cryptography. Lecture 5: Basic Number Theory

NUMBER THEORY AND CODES. Álvaro Pelayo WUSTL

Course MA2C02, Hilary Term 2013 Section 9: Introduction to Number Theory and Cryptography

Applied Cryptography and Computer Security CSE 664 Spring 2018

1 Recommended Reading 1. 2 Public Key/Private Key Cryptography Overview RSA Algorithm... 2

Lecture 1: Introduction to Public key cryptography

Introduction to Cybersecurity Cryptography (Part 5)

Cryptography. Course 1: Remainder: RSA. Jean-Sébastien Coron. September 21, Université du Luxembourg

Lecture 5: Arithmetic Modulo m, Primes and Greatest Common Divisors Lecturer: Lale Özkahya

CPSC 467: Cryptography and Computer Security

CSC 5930/9010 Modern Cryptography: Number Theory

CRYPTOGRAPHY AND NUMBER THEORY

Basic elements of number theory

Basic elements of number theory

Asymmetric Encryption

Introduction to Cryptography. Lecture 6

Discrete Mathematics GCD, LCM, RSA Algorithm

Introduction to Cybersecurity Cryptography (Part 4)

RSA. Ramki Thurimella

Number theory. Myrto Arapinis School of Informatics University of Edinburgh. October 9, /29

Introduction to Cybersecurity Cryptography (Part 4)

Number Theory. Modular Arithmetic

Public Key Cryptography

CIS 551 / TCOM 401 Computer and Network Security

Hans Delfs & Helmut Knebl: Kryptographie und Informationssicherheit WS 2008/2009. References. References

Cryptography IV: Asymmetric Ciphers

dit-upm RSA Cybersecurity Cryptography

Algorithmic Number Theory and Public-key Cryptography

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

Asymmetric Cryptography

Chapter 4 Asymmetric Cryptography

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

Cryptography. P. Danziger. Transmit...Bob...

Elementary Number Theory Review. Franz Luef

CS483 Design and Analysis of Algorithms

Cosc 412: Cryptography and complexity Lecture 7 (22/8/2018) Knapsacks and attacks

ECEN 5022 Cryptography

basics of security/cryptography

Public Key 9/17/2018. Symmetric Cryptography Review. Symmetric Cryptography: Shortcomings (1) Symmetric Cryptography: Analogy

Public Key Cryptography. All secret key algorithms & hash algorithms do the same thing but public key algorithms look very different from each other.

Encryption: The RSA Public Key Cipher

CPSC 467b: Cryptography and Computer Security

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

Homework 4 for Modular Arithmetic: The RSA Cipher

MATH 158 FINAL EXAM 20 DECEMBER 2016

CPSC 467b: Cryptography and Computer Security

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

INTEGERS. In this section we aim to show the following: Goal. Every natural number can be written uniquely as a product of primes.

Ma/CS 6a Class 3: The RSA Algorithm

RSA-256bit 數位電路實驗 TA: 吳柏辰. Author: Trumen

CPSC 467b: Cryptography and Computer Security

2 More on Congruences

ICS141: Discrete Mathematics for Computer Science I

Public Key Encryption

CPSC 467: Cryptography and Computer Security

Definition: For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Ahmet Burak Can Hacettepe University

Public-Key Cryptosystems CHAPTER 4

Number theory (Chapter 4)

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

Theme : Cryptography. Instructor : Prof. C Pandu Rangan. Speaker : Arun Moorthy CS

Addition. Ch1 - Algorithms with numbers. Multiplication. al-khwārizmī. al-khwārizmī. Division 53+35=88. Cost? (n number of bits) 13x11=143. Cost?

Congruence Classes. Number Theory Essentials. Modular Arithmetic Systems

All variables a, b, n, etc are integers unless otherwise stated. Each part of a problem is worth 5 points.

Public Key Cryptography

MATH 145 Algebra, Solutions to Assignment 4

W3203 Discrete Mathema1cs. Number Theory. Spring 2015 Instructor: Ilia Vovsha. hcp://

Elementary Number Theory MARUCO. Summer, 2018

Math 299 Supplement: Modular Arithmetic Nov 8, 2013

Review. CS311H: Discrete Mathematics. Number Theory. Computing GCDs. Insight Behind Euclid s Algorithm. Using this Theorem. Euclidian Algorithm

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

Cryptography: Joining the RSA Cryptosystem

Eindhoven University of Technology MASTER. Kleptography cryptography with backdoors. Antheunisse, M. Award date: 2015

download instant at

AN ALGEBRAIC PROOF OF RSA ENCRYPTION AND DECRYPTION

The RSA Cipher and its Algorithmic Foundations

For your quiz in recitation this week, refer to these exercise generators:

Cryptosystem. Traditional Cryptosystems: The two parties agree on a secret (one to one) function f. To send a message M, thesendersendsthemessage

Discrete mathematics I - Number theory

MATH 501 Discrete Mathematics. Lecture 6: Number theory. German University Cairo, Department of Media Engineering and Technology.

Transcription:

Mathematical Foundations of Public-Key Cryptography Adam C. Champion and Dong Xuan CSE 4471: Information Security Material based on (Stallings, 2006) and (Paar and Pelzl, 2010)

Outline Review: Basic Mathematical Foundations Group Theory Number Theory Case Study: RSA Cryptosystem

Review: Sets A set S is an unordered collection of similar mathematical objects Duplicate objects are not double counted Suppose S 1 = {1, 2, 3, 4} and S 2 = {1, 2, 3, 4, 2}. Both sets have four elements Operations: Intersection: S 1 \ S 2 = {s 1,s 2 : s 1 2 S 1 ^ s 2 2 S 2 } Union: S 1 [ S 2 = {s 1,s 2 : s 1 2 S 1 _ s 2 2 S 2 } Cardinality: S = number of elements in S Well-known sets: N = {1, 2,...} Z = {0, ±1, ±2,...} Q = {p/q : p, q 2 Z ^ q 6= 0} R = {real numbers} C = {complex numbers}

Review: Relations A relation R on sets S 1,...,S N is a subset of their Cartesian product: R S 1 S N R s arity equals N (binary, n-ary) Properties: Reflexive: if for all s 2 S, s R s Symmetric: if s 1 R s 2 =) s 2 R s 1 for all s 1,s 2 2 S Transitive: if s 1 R s 2 ^ s 2 R s 3 =) s 1 R s 3 for all s 1,s 2,s 3 2 S Equivalence relation: a relation R that is reflexive, symmetric, and transitive

Review: Integer Division For an integer divisor d, we can write any integer n as n = d q + r, where r 2 [0,...,d 1]. As n r = d q, n r (mod d). Division by d actually partitions Z into equivalence classes w.r.t. congruence modulo d: Example 1: Odd and even integers. d =2. Every odd integer n can be written as 2 q +1for some integer q. Every even integer m can be written as 2 q 0 for some integer q 0. The equivalence classes are {..., 3, 1, 1, 3,...} and {..., 4, 2, 0, 2, 4,...}. Example 2: d =5. Notice 8 3=5 1and 23 3 = 5 4, so 23 8 (mod 5). Remainders are not unique! What are the equivalence classes? See (Knuth, 1997; Paar and Pelzl, 2010) for more details.

Outline Review: Basic Mathematical Foundations Group Theory Number Theory Case Study: RSA Cryptosystem

Groups I A group comprises a set G and an operator, which maps each pair (a, b) (where a, b 2 G) to (a b) 2 G subject to the following axioms: (Stallings, 2006): (A1) Closure: a, b 2 G =) a b 2 G; (A2) Associativity: a (b c) =(a b) c for all a, b, c 2 G; (A3) Identity element: There is an element " 2 G such that a " = " a = a for all a 2 G. (A4) Inverse element: For each a 2 G, there is an element a 0 2 G such that a a 0 = a 0 a = ". Abelian groups obey axiom (A5), commutativity: a b = b a for all a, b 2 G. Not all groups are abelian! refers to any generic operator that obeys axioms (A1) (A4)

Groups II Example group: S n, the set of all possible permutations of N = {1,...,n} distinct symbols, denotes permutation operation (Stallings, 2006) Permuting a permutation of N yields a permutation of N, e.g., {3, 2, 1} {1, 3, 2} = {2, 3, 1} for n =3 Associativity holds too Identity element: {1,...,n} Inverse element: permutation mapping N s current permutation to {1,...,n}

Rings I A ring R is an abelian group with addition and multiplication operations +, satisfying the following axioms: (Stallings, 2006) (A1) (A5) Abelian group axioms (closure under addition operator +, associativity of addition, existence of identity element 0, existence of inverse element a) (M1) Closure under multiplication: for all a, b 2 R, a b 2 R (M2) Associativity of multiplication: (a b) c = a (b c) for all a, b, c 2 R (M3) Distributive laws: a (b + c) =(a b)+(a c) for all a, b, c 2 R; (a + b) c =(a c)+(b c) for all a, b, c 2 R.

Rings II Commutative rings satisfy axiom (M4), commutativity of multiplication: a b = b a for all a, b 2 R Integral domains are commutative rings satisfying the following additional axioms: (M5) Multiplicative identity: There is an element 1 2 R such that a 1=1 a = a for all a 2 R (M6) No zero divisors: If a, b 2 R and a b =0, then a =0or b =0

Rings III Example: Ring of integers Z m = {0,...,m 1} with addition, multiplication operators +, such that, for a, b 2 Z m : (Paar and Pelzl, 2010) (1) a + b = c (mod m) (c 2 Z m ); (2) a b = d (mod m) (d 2 Z m ). If m =9, then Z 9 = {0, 1, 2, 3, 4, 5, 6, 7, 8}. 6 + 8 = 14 5 (mod 9) 6 8 = 48 3 (mod 9) Multiplicative inverse exists only for integers a 2 Z m coprime to m. For such integers, (a b) (a c) (modn) =) b c (mod n).

Fields A field F is a set of elements with addition and multiplication operations +, satisfying the following axioms: (A1) (M6) Integral domain axioms (M7) Multiplicative inverse: For all a 2 F (except 0), there is an element a 1 2 F such that a a 1 =(a 1 a) =1. Examples of fields: rational numbers Q, real numbers R, complex numbers C

Outline Review: Basic Mathematical Foundations Group Theory Number Theory Case Study: RSA Cryptosystem

Primality An integer n is prime if and only if n has two divisors: 1 and n. Example primes: P = {2, 3, 5, 7, 11, 13, 17, 19,...} = {p 1,p 2,...} Fundamental Theorem of Arithmetic: Every integer n>1 is either prime or can be written as a unique product of primes. Examples: 7=7 1 =2 0 3 0 5 0 7 1 60 = 2 2 3 5=2 2 3 1 5 1 7 0 More generally, n = p e 1 1 pe 2 2 = Y p i 2P p e i i, where e i 2{0, 1, 2,...} (1)

Greatest Common Divisor The greatest common divisor (GCD) of integers m and n is the largest integer d that divides both m and n. Notation: gcd(m, n) =d. If gcd(m, n) =1for integers m and n, then m and n are coprime. How do we find the GCD? Small numbers: multiply common prime factors. Example: m = 84,n= 30. m =2 2 3 7; n =2 3 5; gcd(m, n) =2 3=6 This approach is inefficient for large numbers

Euclid s Algorithm Faster algorithm to find GCD, exploits the following theorem: gcd(m, n) =gcd(n, m mod n) (m>n) PROOF: Let d = gcd(m, n). As d m and d n, we can write m = d k and n = d ` for coprime integers k, ` (k >`>0). (k `) and ` are coprime too. Then gcd(x y, y) = gcd(d (k `),d `) =d. Algorithm 1 EUCLID(m, n) 1: A m; B n 2: while B 6= 0do 3: R A mod B 4: A B 5: B R 6: return A Compute gcd(84, 30) and gcd(973, 301).

Extended Euclidean Algorithm If gcd(m, n) =1for positive integer m<n, there is a positive multiplicative inverse modulo m, n 1, such that n n 1 =1modm Euclidean algorithm can be extended to compute n 1 if it exists (and return gcd(m, n)) (Stallings, 2006) Algorithm 2 EXTENDED EUCLID(m, n) 1: (A 1,A 2,A 3 ) (1, 0,m); (B 1,B 2,B 3 ) (0, 1,n) 2: while true do 3: if B 3 == 0 then return A 3 // no inverse 4: if B 3 == 1 then return B 3 // B 2 = n 1 mod m 5: Q = ba 3 /B 3 c 6: (T 1,T 2,T 3 ) (A 1 Q B 1,A 2 Q B 2,A 3 Q B 3 ) 7: (A 1,A 2,A 3 ) (B 1,B 2,B 3 ) 8: (B 1,B 2,B 3 ) (T 1,T 2,T 3 )

Euler s Totient Function I Consider the ring Z m = {0,...,m 1}. We want to find how many integers in Z m are coprime to m, i.e., '(m). Convention: '(1) = 1. Let s compute '(5) and '(6)...

Euler s Totient Function II If m is prime, '(m) =(m 1). Otherwise, we need to determine m s (unique) prime factorization to compute '(m). Recall Eq. (1): m = Y p i 2P p e i i, where e i 2{0, 1, 2,...}. Let be the smallest prime larger than m ( is the n-th prime). Then '(m) = ny i=1 (p e i i p e i 1 i ). (2) Let s compute '(240) using Eq. (2)...

More Number Theory Theorems Fermat s Little Theorem: Let a be an integer and p be a prime. Then a p a (mod p). Equivalently, a p 1 1(modp). So we can invert a modulo p: a 1 a p 2 (mod p). Euler s Theorem: Let a and m be integers such that gcd(a, m) =1. Then a '(m) 1(modm). Notice that Euler s Theorem is a generalization of Fermat s Little Theorem (arbitrary modulus).

Outline Review: Basic Mathematical Foundations Group Theory Number Theory Case Study: RSA Cryptosystem

RSA Cryptosystem Widely used public-key (asymmetric) cryptosystem Security based on the following: it s easy to multiply large primes, but very hard to factor the product (Paar and Pelzl, 2010) Computations in integer ring Z n, where plaintext m 2 Z n RSA Encryption: Given public key (n, e) =k pub and plaintext m, the encryption function is c = E kpub (m) m e (mod n), (3) where x, y 2 Z n. RSA Decryption: Given private key (n, d) =k priv and ciphertext c, the decryption function is where x, y 2 Z n. m = D kpriv c d (mod n), (4)

RSA Key Generation Algorithm 3 RSA KEY GENERATION 1: Choose two large primes p and q 2: Compute n p q 3: Compute '(n) =(p 1)(q 1) 4: Select public exponent e 2{1, 2,...,'(n)} such that gcd(e, '(n)) = 1 5: Choose private exponent d such that d e 1(mod'(n)) Suppose Alice picks p =3and q =11and wants to send m =4to Bob. How would the RSA scheme work?

RSA in Practice This textbook RSA scheme has several weaknesses: (Paar and Pelzl, 2010) RSA encryption is deterministic Plaintext values m =0,m=1,m= 1 produce the same ciphertext values (c =0,c=1,c= 1) Attacks are possible with small plaintext and exponent values In practice, RSA encryption is combined with zero padding, salt, and message hash functions to securely transmit messages

RSA Digital Signatures The RSA algorithm can be repurposed for digitally signing a message m Public key k pub =(n, d), private key k priv =(n, e) Signing: Compute s = Sign kpriv (m) m d (mod n) Verification: Compute m 0 = s e mod n. If m 0 m (mod n), the signature is valid.

Questions & Comments? Thank you! If you find this material interesting, consider taking CSE 5473 (Introduction to Network Security) and/or CSE 5431 (Introduction to Cryptography). More to explore: (Sage Math, 2012) (http://www.sagemath.org); Sage-based notes on the RSA cryptosystem (van Nguyen, 2010); Free book on number theory (Stein, 2008)

References I Knuth, D. E. (1997). The Art of Computer Programming, volume 1. Addison-Wesley, 3rd edition. Paar, C. and Pelzl, J. (2010). Understanding Cryptography: A Textbook for Students and Practioners. Springer, 2nd edition. http://crypto-textbook.com. Sage Math (2012). http://www.sagemath.org. Stallings, W. (2006). Cryptography and Network Security. Addison-Wesley, 4th edition. Stein, W. (2008). Elementary Number Theory: Primes, Congruences, and Secrets. Springer. http://wstein.org/ent/. van Nguyen, M. (2010). Number Theory and the RSA Cryptosystem. https://bitbucket.org/mvngu/numtheory-crypto/ downloads/numtheory-crypto-1.1.pdf.