Public-Key Cryptography. Professor Yanmin Gong Week 3: Sep. 7

Similar documents
18733: Applied Cryptography Anupam Datta (CMU) Basic key exchange. Dan Boneh

Online Cryptography Course. Basic key exchange. Trusted 3 rd par7es. Dan Boneh

CSCI 454/554 Computer and Network Security. Topic 5.2 Public Key Cryptography

Outline. CSCI 454/554 Computer and Network Security. Introduction. Topic 5.2 Public Key Cryptography. 1. Introduction 2. RSA

Chapter 9 Public Key Cryptography. WANG YANG

Outline. Public Key Cryptography. Applications of Public Key Crypto. Applications (Cont d)

Public Key Algorithms

Dr. Jinyuan (Stella) Sun Dept. of Electrical Engineering and Computer Science University of Tennessee Fall 2010

Lecture 6 - Cryptography

Overview. Public Key Algorithms I

CSC 474/574 Information Systems Security

Chapter 9. Public Key Cryptography, RSA And Key Management

Public key encryption: definitions and security

Public Key Cryptography

Distributed Systems. 26. Cryptographic Systems: An Introduction. Paul Krzyzanowski. Rutgers University. Fall 2015

Computer Security. 08. Cryptography Part II. Paul Krzyzanowski. Rutgers University. Spring 2018

Key Exchange. References: Applied Cryptography, Bruce Schneier Cryptography and Network Securiy, Willian Stallings

Public Key Algorithms

Module: Cryptographic Protocols. Professor Patrick McDaniel Spring CMPSC443 - Introduction to Computer and Network Security

Diffie-Hellman. Part 1 Cryptography 136

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl. Chapter 6 Introduction to Public-Key Cryptography

Public Key Algorithms

ASYMMETRIC (PUBLIC-KEY) ENCRYPTION. Mihir Bellare UCSD 1

CSC/ECE 774 Advanced Network Security

Lecture 2 Applied Cryptography (Part 2)

Key Exchange. Secure Software Systems

PUBLIC KEY CRYPTO. Anwitaman DATTA SCSE, NTU Singapore CX4024. CRYPTOGRAPHY & NETWORK SECURITY 2018, Anwitaman DATTA

Chapter 3 Public Key Cryptography

ASYMMETRIC (PUBLIC-KEY) ENCRYPTION. Mihir Bellare UCSD 1

Computer Security 3/23/18

Cryptography Symmetric Cryptography Asymmetric Cryptography Internet Communication. Telling Secrets. Secret Writing Through the Ages.

Intro to Public Key Cryptography Diffie & Hellman Key Exchange

LECTURE 4: Cryptography

Applied Cryptography and Computer Security CSE 664 Spring 2018

Auth. Key Exchange. Dan Boneh

Topics. Number Theory Review. Public Key Cryptography

Understanding Cryptography A Textbook for Students and Practitioners by Christof Paar and Jan Pelzl. Chapter 6 Introduction to Public-Key Cryptography

CS 6324: Information Security More Info on Key Establishment: RSA, DH & QKD

Cryptography CS 555. Topic 16: Key Management and The Need for Public Key Cryptography. CS555 Spring 2012/Topic 16 1

Key Establishment and Authentication Protocols EECE 412

Introduction to Cryptography Lecture 7

Chapter 7 Public Key Cryptography and Digital Signatures

Encryption. INST 346, Section 0201 April 3, 2018

The ElGamal Public- key System

ISA 662 Internet Security Protocols. Outline. Prime Numbers (I) Beauty of Mathematics. Division (II) Division (I)

CS 161 Computer Security

Kurose & Ross, Chapters (5 th ed.)

CSE 127: Computer Security Cryptography. Kirill Levchenko

What did we talk about last time? Public key cryptography A little number theory

Introduction. CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell

Introduction to Cryptography Lecture 7

CS155. Cryptography Overview

Public-Key Cryptography

Public-Key Encryption, Key Exchange, Digital Signatures CMSC 23200/33250, Autumn 2018, Lecture 7

Public Key Cryptography, OpenPGP, and Enigmail. 31/5/ Geek Girls Carrffots GVA

Cryptography & Key Exchange Protocols. Faculty of Computer Science & Engineering HCMC University of Technology

Other Topics in Cryptography. Truong Tuan Anh

Part VI. Public-key cryptography

Cryptography III. Public-Key Cryptography Digital Signatures. 2/1/18 Cryptography III

This chapter continues our overview of public-key cryptography systems (PKCSs), and begins with a description of one of the earliest and simplest

Introduction to Cryptography and Security Mechanisms: Unit 5. Public-Key Encryption

Crypto CS 485/ECE 440/CS 585 Fall 2017

ח'/סיון/תשע "א. RSA: getting ready. Public Key Cryptography. Public key cryptography. Public key encryption algorithms

LECTURE NOTES ON PUBLIC- KEY CRYPTOGRAPHY. (One-Way Functions and ElGamal System)

Computer Security. 08r. Pre-exam 2 Last-minute Review Cryptography. Paul Krzyzanowski. Rutgers University. Spring 2018

Public-Key Cryptography

Public Key Cryptography

Cryptographic Systems

Public-key encipherment concept

PROTECTING CONVERSATIONS

CS 161 Computer Security

Public Key (asymmetric) Cryptography

CSC 5930/9010 Modern Cryptography: Public Key Cryptography

CSC 774 Network Security

Network Security. Chapter 4 Public Key Cryptography. Public Key Cryptography (4) Public Key Cryptography

CSE 3461/5461: Introduction to Computer Networking and Internet Technologies. Network Security. Presentation L

RSA. Public Key CryptoSystem

Number Theory and RSA Public-Key Encryption

L13. Reviews. Rocky K. C. Chang, April 10, 2015

CS408 Cryptography & Internet Security

Cryptography and Network Security. Sixth Edition by William Stallings

10.1 Introduction 10.2 Asymmetric-Key Cryptography Asymmetric-Key Cryptography 10.3 RSA Cryptosystem

Cryptography Lecture 4. Attacks against Block Ciphers Introduction to Public Key Cryptography. November 14, / 39

Grenzen der Kryptographie

More on Cryptography CS 136 Computer Security Peter Reiher January 19, 2017

CS155. Cryptography Overview

Lecture 9: Public-Key Cryptography CS /05/2018

Great Theoretical Ideas in Computer Science. Lecture 27: Cryptography

1. Diffie-Hellman Key Exchange

CIS 4360 Secure Computer Systems Applied Cryptography

Encryption 2. Tom Chothia Computer Security: Lecture 3

ASYMMETRIC CRYPTOGRAPHY

Outline. Data Encryption Standard. Symmetric-Key Algorithms. Lecture 4

Secure Multiparty Computation

Other Uses of Cryptography. Cryptography Goals. Basic Problem and Terminology. Other Uses of Cryptography. What Can Go Wrong? Why Do We Need a Key?

Public key encryp4on: defini4ons and security

Spring 2010: CS419 Computer Security

Introduction to Cryptography and Security Mechanisms. Abdul Hameed

Cryptographic Protocols 1

Introduction. Cambridge University Press Mathematics of Public Key Cryptography Steven D. Galbraith Excerpt More information

Transcription:

Public-Key Cryptography Professor Yanmin Gong Week 3: Sep. 7

Outline Key exchange and Diffie-Hellman protocol Mathematical backgrounds for modular arithmetic RSA Digital Signatures

Key management Problem: difficult n users. Storing mutual secret keys is Total: O(n) keys per user

A better solution Online Trusted 3 rd Party (TTP) TTP

Generating keys: a toy protocol Alice wants a shared key with Bob. only. Eavesdropping security Bob (k B ) Alice (k A ) TTP ticket Alice wants key with Bob choose random k AB k AB k AB (E,D) a CPA-secure cipher

Generating keys: a toy protocol Alice wants a shared key with Bob. only. Eavesdropping security Eavesdropper sees: E(k A, A, B ll k AB ) ; E(k B, A, B ll k AB ) (E,D) is CPA-secure eavesdropper learns nothing about k AB Note: TTP needed for every key exchange, knows all session keys. (basis of Kerberos system)

Toy protocol: insecure against active attacks Example: insecure against replay attacks Attacker records session between Alice and merchant Bob For example a book order Attacker replays session to Bob Bob thinks Alice is ordering another copy of book

Key question Can we generate shared keys without an online trusted 3 rd party? Answer: yes! Starting point of public-key cryptography: Merkle (1974), Diffie-Hellman (1976), RSA (1977) More recently: ID-based enc. (BF 2001), Functional enc. (BSW 2011)

Key exchange without an online TTP? Goal: Alice and Bob want shared key, unknown to eavesdropper For now: security against eavesdropping only (no tampering) Alice Bob eavesdropper?? Can this be done using generic symmetric crypto?

Merkle Puzzles (1974) Answer: yes, but very inefficient Main tool: puzzles Problems that can be solved with some effort Example: E(k,m) a symmetric cipher with k {0,1} 128 puzzle(p) = E(P, message ) where P = 0 96 ll b 1 b 32 Goal: find P by trying all 2 32 possibilities

Merkle puzzles Alice: prepare 2 32 puzzles For i=1,, 2 32 choose random P i {0,1} 32 and x i, k i {0,1} 128 set puzzle i E( 0 96 ll P i, Puzzle # x i ll k i ) Send puzzle 1,, puzzle 2 32 to Bob Bob: choose a random puzzle j and solve it. Obtain ( x j, k j ). Send x j to Alice Alice: lookup puzzle with number x j. secret Use k j as shared

In a figure Alice puzzle 1,, puzzle n x j Bob k j k j Alice s work: O(n) Bob s work: O(n) (prepare n puzzles) (solve one puzzle) Eavesdropper s work: O( n 2 ) (e.g. 2 64 time)

The Diffie-Hellman protocol (1977) Fix a finite cyclic group G (e.g G = (Z p ) * ) of order n Fix a generator g in G (i.e. G = {1, g, g 2, g 3,, g n-1 } ) Alice choose random a in {1,,n} A = g a B a = (g b ) a = B = g b Bob choose random b in {1,,n} k AB = g ab = (g a ) b = A b

Security (much more on this later) Eavesdropper sees: (mod p) p, g, A=g a (mod p), and B=g b Can she compute g ab (mod p)?? More generally: define DH g (g a, g b ) = g ab (mod p) How hard is the DH function mod p?

How hard is the DH function mod p? Suppose prime p is n bits long. Best known algorithm (GNFS): run time exp( ) cipher key size modulus size 80 bits 1024 bits 128 bits 3072 bits 256 bits (AES) 15360 bits Elliptic Curve size 160 bits 256 bits 512 bits As a result: slow transition away from (mod p) to elliptic curves

Insecure against man-in-the-middle As described, the protocol is insecure against active attacks Alice MiTM Bob

Using D-H in phone book mode

ElGamal: converting to pub-key enc. (1984) Fix a finite cyclic group G (e.g G = (Z p ) * ) of order n Fix a generator g in G (i.e. G = {1, g, g 2, g 3,, g n-1 } ) Alice choose random a in {1,,n} A = g a Treat as a public key Bob choose random b in {1,,n} compute g ab = A b, [ ct = B = g b derive symmetric key k,, encrypt message m with k ]

ElGamal: converting to pub-key enc. (1984) Fix a finite cyclic group G (e.g G = (Z p ) * ) of order n Fix a generator g in G (i.e. G = {1, g, g 2, g 3,, g n-1 } ) Alice choose random a in {1,,n} A = g a To decrypt: compute g ab = B a, derive k, and decrypt Treat as a public key Bob choose random b in {1,,n} compute g ab = A b, [ ct = B = g b derive symmetric key k,, encrypt message m with k ]

Diffie-Hellman Key Exchange in Practice Insecurity against man-in-the-middle attack First demonstration that asymmetric techniques and number theoretic problems could be used to alleviate the key distribution in cryptography

Public key encryption Bob: generates (PK, SK) and gives PK to Alice Alice Bob m c c m E D pk Invented and published in 1975 A public/private key pair is used Public key can be announced to everyone Private key is kept secret by the owner of the key Also known as asymmetric cryptography Much slower to compute than secret key cryptography sk

Applications 1. Message integrity with digital signatures Alice computes hash, signs with her private key (no one else can do this without her key) Bob verifies hash on receipt using Alice s public key using the verification equation

Applications (Cont.) The digital signature is verifiable by anybody Only one person can sign the message: nonrepudiation Non-repudiation is not possible for secret key cryptography

Applications (cont.) 2. Communicating securely over an insecure channel 2.1 Session setup (for now, only eavesdropping security) Alice Generate (pk, sk) x pk E(pk, x) Bob choose random x (e.g. 48 bytes) 2.2 Non-interactive applications: (e.g. Email) Bob sends email to Alice encrypted using pk alice Note: Bob needs pk alice (public key management)

Public key encryption Def: a public-key encryption system is a triple of algs. (G, E, D) G(): randomized alg. outputs a key pair (pk, sk) E(pk, m): randomized alg. that takes m M and outputs c C D(sk,c): det. alg. that takes c C and outputs m M or Consistency: (pk, sk) output by G : m M: D(sk, E(pk, m) ) = m

Public key encryption: constructions Constructions generally rely on hard problems from number theory and algebra It must be computationally easy to generate a public/private key pair hard to determine the private key, given the public key It must be computationally easy to encrypt using the public key Easy to decrypt using the private key Hard to recover the plaintext message from just the ciphertext and the public key

Trapdoor functions (TDF)

RSA (Rivest, Shamir, Adelman) A dominant public key algorithm Provides both public key encryption and digital signatures Basis: factorization of large numbers is hard Variable key length (1024 bits or greater) Variable plaintext block size Plaintext block size must be smaller than key size Ciphertext block size is same as key size Very widely used: SSL/TLS: certificates and key-exchange Secure e-mail and file systems A method for obtaining Digital Signatures and Public Key cryptosystems, Communications of the ACM, Feb., 1978

https://en.wikipedia.org/wiki/extended_euclidean_algorithm

Reminder of Results Let N = p q where p,q are prime Z N } Z N = {0,1,2,,N-1} ; (Z N ) * = {invertible elements in Facts: x Î Z N is invertible Û gcd(x,n) = 1 Number of elements in (Z N ) * is j(n) = (p-1)(q-1) = N-p-q+1 Euler s thm: " xî (Z N ) * : x j(n) = 1

RSA Key Generation generating a public/private key pair Find large primes p,q»1024 bits. Let N=pq Don t disclose p and q! j(n) = (p-1)(q-1) choose integers e, d s.t. e d = 1 (mod j(n) ) output public key = (N, e), private key = (N, d)

RSA Encryption/Decryption F -1 ( sk, y) = y d ; y d = RSA(x) d = x ed = x kj(n)+ 1 = (x j(n) ) k x = x

Is RSA secure (Cont.) Deterministic encryption an attacker can successfully launch a chosen plaintext attack against the cryptosystem Solution: pad plaintext message with random text before encryption

Digital Signatures

RSA signatures Inverse use of public key and private key

DSA signatures Based on a different hard problem: discrete logarithm problem

Review: secret vs. public key crypto

The symmetric/asymmetric key tradeoff