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

Similar documents
Chapter 8 Public-key Cryptography and Digital Signatures

CIS 551 / TCOM 401 Computer and Network Security

Lecture 1: Introduction to Public key cryptography

8.1 Principles of Public-Key Cryptosystems

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

RSA Algorithm. Factoring, EulerPhi, Breaking RSA. Çetin Kaya Koç Spring / 14

Cryptography IV: Asymmetric Ciphers

RSA RSA public key cryptosystem

Public Key Cryptography

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

Number Theory & Modern Cryptography

10 Public Key Cryptography : RSA

Asymmetric Encryption

Security Issues in Cloud Computing Modern Cryptography II Asymmetric Cryptography

Public-Key Cryptosystems CHAPTER 4

Lecture V : Public Key Cryptography

RSA. Ramki Thurimella

Cryptography and RSA. Group (1854, Cayley) Upcoming Interview? Outline. Commutative or Abelian Groups

The RSA cryptosystem and primality tests

Public Key Algorithms

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

Chapter 4 Asymmetric Cryptography

Asymmetric Cryptography

CPSC 467b: Cryptography and Computer Security

LECTURE 5: APPLICATIONS TO CRYPTOGRAPHY AND COMPUTATIONS

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

CRYPTOGRAPHY AND NUMBER THEORY

CIS 6930/4930 Computer and Network Security. Topic 5.2 Public Key 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).

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

Circuit Complexity. Circuit complexity is based on boolean circuits instead of Turing machines.

10 Modular Arithmetic and Cryptography

Mathematics of Cryptography

Lecture Notes, Week 6

Introduction to Modern Cryptography. Benny Chor

Topics in Cryptography. Lecture 5: Basic Number Theory

Ma/CS 6a Class 3: The RSA Algorithm

Public Key Cryptography

Introduction to Cryptography. Lecture 6

and Other Fun Stuff James L. Massey

NUMBER THEORY FOR CRYPTOGRAPHY

Public Key Cryptography

Outline. Available public-key technologies. Diffie-Hellman protocol Digital Signature. Elliptic curves and the discrete logarithm problem

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

Introduction to Cryptography. Lecture 8

Introduction to Public-Key Cryptosystems:

dit-upm RSA Cybersecurity Cryptography

My brief introduction to cryptography

Gurgen Khachatrian Martun Karapetyan

Question: Total Points: Score:

Great Theoretical Ideas in Computer Science

Introduction to Modern Cryptography. Lecture RSA Public Key CryptoSystem 2. One way Trapdoor Functions

Public-key Cryptography and elliptic curves

ECE 646 Lecture 9. RSA: Genesis, operation & security

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

during transmission safeguard information Cryptography: used to CRYPTOGRAPHY BACKGROUND OF THE MATHEMATICAL

Powers in Modular Arithmetic, and RSA Public Key Cryptography

Ti Secured communications

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

Methods of Public-Key Cryptography. Émilie Wheeler

RSA ENCRYPTION USING THREE MERSENNE PRIMES

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

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

Practice Assignment 2 Discussion 24/02/ /02/2018

University of Tokyo: Advanced Algorithms Summer Lecture 6 27 May. Let s keep in mind definitions from the previous lecture:

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

Intro to Public Key Cryptography Diffie & Hellman Key Exchange

Network Security Technology Spring, 2018 Tutorial 3, Week 4 (March 23) Due Date: March 30

basics of security/cryptography

Discrete Mathematics GCD, LCM, RSA Algorithm

Lecture 19: Public-key Cryptography (Diffie-Hellman Key Exchange & ElGamal Encryption) Public-key Cryptography

Introduction. will now introduce finite fields of increasing importance in cryptography. AES, Elliptic Curve, IDEA, Public Key

Encryption: The RSA Public Key Cipher

2. Cryptography 2.5. ElGamal cryptosystems and Discrete logarithms

CPSC 467: Cryptography and Computer Security

Cryptography. pieces from work by Gordon Royle

An Introduction to Cryptography

Number Theory. Modular Arithmetic

MATH 158 FINAL EXAM 20 DECEMBER 2016

1 Number Theory Basics

ECE596C: Handout #11

Fundamentals of Modern Cryptography

CPSC 467b: Cryptography and Computer Security

The Elliptic Curve in https

Public-key Cryptography and elliptic curves

Theory of Computation Chapter 12: Cryptography

THE CUBIC PUBLIC-KEY TRANSFORMATION*

CHALMERS GÖTEBORGS UNIVERSITET. TDA352 (Chalmers) - DIT250 (GU) 11 April 2017, 8:30-12:30

THE RSA CRYPTOSYSTEM

Math 412: Number Theory Lecture 13 Applications of

Public-Key Encryption: ElGamal, RSA, Rabin

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

Introduction. What is RSA. A Guide To RSA by Robert Yates. Topics

Biomedical Security. Overview 9/15/2017. Erwin M. Bakker

The RSA public encryption scheme: How I learned to stop worrying and love buying stuff online

Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur

CPSC 467: Cryptography and Computer Security

Provable Security for Public-Key Schemes. Outline. I Basics. Secrecy of Communications. Outline. David Pointcheval

Math/Mthe 418/818. Review Questions

RSA: Genesis, Security, Implementation & Key Generation

Transcription:

Number Theory, Public Key Cryptography, RSA Ahmet Burak Can Hacettepe University abc@hacettepe.edu.tr The Euler Phi Function For a positive integer n, if 0<a<n and gcd(a,n)=1, a is relatively prime to n. Given an integer n, ϕ(n) is the number of positive integers less than or equal to n and relatively prime to n. 1 2 The Euler Phi Function Theorem: Formula for ϕ(n) Let p be prime, e, m, n be positive integers 1) ϕ(p) = p-1 2) if gcd(m,n)=1, then ϕ(mn)=ϕ(m)ϕ(n) 3) ϕ(p e ) = p e p e-1 e1 e2 ek 4) If n = p p... p then 1 2 1 1 1 ϕ( n) = n(1 )(1 )...(1 ) p p p k 1 2 k Fermat s Little Theorem Fermat s Little Theorem If p is a prime number and a is a natural number that is not a multiple of p, then a p-1 1 (mod p) 3 4

Euler s Theorem Euler s Theorem Given integer n>1, such that gcd(a,n)=1 then Corollary a ϕ(n) 1 (mod n) Given integer n>1 such that gcd(a,n)=1, then a ϕ(n)-1 mod n is a multiplicative inverse of a mod n. Consequence of Euler s Theorem Principle of Modular Exponentiation Given integer n>1, x, y, and a positive integers with gcd(a,n)=1. If x y(mod ϕ(n)), then Proof idea: a x a y (mod n) a x = a kϕ(n)+y = a y (a ϕ(n) ) k by applying Euler s theorem we obtain a x a y (mod n) 5 6 Diffie-Hellman Key Exchange Diffie-Hellman proposed a cryptographic protocol to exchange keys among two parties in1976. Public parameters: p: A large prime g: Base (generator) Secret parameters: α, β {0, 1, 2,...,p-2} Security of Diffie-Hellman Discrete Logarithm Problem (DLP): Given p, g, g α mod p, what is α? easy in Z, hard in Z p Diffie-Hellman Problem (DHP): Given p, g, g α mod p, g β mod p, what is g αβ mod p? Alice g α mod p Bob DHP is as hard as DLP. computes (g β ) α mod p g β mod p K = g αβ mod p computes (g α ) β mod p 7 8

Commutative Encryption An encryption scheme is commutative if E K1 [E K2 [M]] = E K2 [E K1 [M]] Given a commutative encryption scheme, then D K1 [D K2 [E K1 [E K2 [M]] = M Pohlig-Hellman Exponentiation Cipher A commutative exponentiation cipher encryption key (e, p), where p is a prime decryption key (d, p), where ed 1 (mod (p-1)) or in other words d e -1 (mod (p-1)) to encrypt M, compute C = M e mod p to decrypt C, compute M = C d mod p = M ed mod p Most symmetric encryption scheme are not commutative such as DES and AES. 9 10 Asymmetric Encryption Functions An asymmetric encryption function: Encryption (K) and decryption (K -1 ) keys are different. Knowledge of the encryption key is not sufficient for deriving the decryption key efficiently. Hence, the encryption key can be made public. Public Key Encryption Each party has a PAIR (K, K -1 ) of keys: K is the public key K -1 is the private key D K -1 [E K [M]]=M Plaintext K K -1 Encryption Decryption Ciphertext Original Plaintext The public-key K may be made publicly available. Many can encrypt with the public key, only one can decrypt. Knowing the public-key and the cipher, it is computationally infeasible to compute the private key. 11 12

Solutions with Public Key Cryptography Key distribution solution: Alice makes her encryption key K public Everyone can send her an encrypted message: C = E K (P) Only Alice can decrypt it with the private key K -1 : P = D -1 K (C) Source Authentication Solution: Only Alice can sign a message, using K -1. Anyone can verify the signature, using K. Only if such a function could be found... RSA Algorithm Invented in 1978 by Ron Rivest, Adi Shamir and Leonard Adleman Published as R L Rivest, A Shamir, L Adleman, "On Digital Signatures and Public Key Cryptosystems", Communications of the ACM, vol 21 no 2, pp120-126, Feb 1978 Security relies on the difficulty of factoring large composite numbers Essentially the same algorithm was discovered in 1973 by Clifford Cocks, who works for the British intelligence 13 14 RSA Public Key Crypto System Choose large primes p, q Compute n = pq and ϕ(n) = (q-1)(p-1) Choose e, such that gcd(e, ϕ(n)) = 1. Take e to be a prime Compute d e -1 mod ϕ(n), such that ed 1 mod ϕ(n) Public key: n, e Private key: d Encryption: C= E(M) = M e mod n Decryption: D(C) = C d mod n RSA Encryption Encryption: C = E(M) = M e mod n, Decryption: D(C) = C d mod n. Why does it work? D(C) = (M e ) d mod n = M ed mod n = M kϕ(n) + 1 mod n, for some k = (M ϕ(n) ) k M mod n = M RSA problem: Given n, e, M e mod n, what is M? Computing d is equivalent to factoring n. The security is based on difficulty of factoring large integers. 15 16

RSA Example Let p = 11, q = 7, then n = 77, ϕ(n) = 60 Let e = 37, then d = 13 (ed = 481; ed mod 60 = 1) Let M = 15, then C M e mod n C 15 37 (mod 77) = 71 M C d mod n M 71 13 (mod 77) = 15 RSA Implementation The security of RSA depends on how large n is, which is often measured in the number of bits for n. Current recommendation is 1024 bits for n. p and q should have the same bit length, so for 1024 bits RSA, p and q should be about 512 bits. p-q should not be small. In general, p, q randomly selected and then tested for primality Many implementations use the Rabin-Miller test, (probabilistic test) 17 18