Overview of Public-Key Cryptography



Similar documents
CSCE 465 Computer & Network Security

CIS 6930 Emerging Topics in Network Security. Topic 2. Network Security Primitives

CIS 5371 Cryptography. 8. Encryption --

Network Security. Computer Networking Lecture 08. March 19, HKU SPACE Community College. HKU SPACE CC CN Lecture 08 1/23

Elements of Applied Cryptography Public key encryption

Public Key (asymmetric) Cryptography

Notes on Network Security Prof. Hemant K. Soni

Forward Secrecy: How to Secure SSL from Attacks by Government Agencies

Lecture 6 - Cryptography

Outline. Computer Science 418. Digital Signatures: Observations. Digital Signatures: Definition. Definition 1 (Digital signature) Digital Signatures

Public Key Cryptography and RSA. Review: Number Theory Basics

Network Security. Chapter 2 Basics 2.2 Public Key Cryptography. Public Key Cryptography. Public Key Cryptography

Public Key Cryptography Overview

Lukasz Pater CMMS Administrator and Developer

The Mathematics of the RSA Public-Key Cryptosystem

Mathematics of Internet Security. Keeping Eve The Eavesdropper Away From Your Credit Card Information

Cryptography and Network Security

Digital Signatures. Murat Kantarcioglu. Based on Prof. Li s Slides. Digital Signatures: The Problem

Computer Security: Principles and Practice

Digital Signature. Raj Jain. Washington University in St. Louis

Principles of Public Key Cryptography. Applications of Public Key Cryptography. Security in Public Key Algorithms

QUANTUM COMPUTERS AND CRYPTOGRAPHY. Mark Zhandry Stanford University

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

CRYPTOGRAPHY IN NETWORK SECURITY

Final Exam. IT 4823 Information Security Administration. Rescheduling Final Exams. Kerberos. Idea. Ticket

Introduction to Cryptography CS 355

7! Cryptographic Techniques! A Brief Introduction

Network Security. Security Attacks. Normal flow: Interruption: 孫 宏 民 Phone: 國 立 清 華 大 學 資 訊 工 程 系 資 訊 安 全 實 驗 室

Cryptography and Network Security Chapter 9

Public Key Cryptography. c Eli Biham - March 30, Public Key Cryptography

Table of Contents. Bibliografische Informationen digitalisiert durch

Lecture 3: One-Way Encryption, RSA Example

Lecture 9: Application of Cryptography

Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY. Sourav Mukhopadhyay

Applied Cryptography Public Key Algorithms

Signature Schemes. CSG 252 Fall Riccardo Pucella

Computer Networks. Network Security 1. Professor Richard Harris School of Engineering and Advanced Technology

RSA Attacks. By Abdulaziz Alrasheed and Fatima

Cryptosystems. Bob wants to send a message M to Alice. Symmetric ciphers: Bob and Alice both share a secret key, K.

Authentication requirement Authentication function MAC Hash function Security of

Software Tool for Implementing RSA Algorithm

Network Security. Gaurav Naik Gus Anderson. College of Engineering. Drexel University, Philadelphia, PA. Drexel University. College of Engineering

Secure Network Communication Part II II Public Key Cryptography. Public Key Cryptography

CSC474/574 - Information Systems Security: Homework1 Solutions Sketch

Cryptography and Network Security

A New Efficient Digital Signature Scheme Algorithm based on Block cipher

Network Security [2] Plain text Encryption algorithm Public and private key pair Cipher text Decryption algorithm. See next slide

Security. Contents. S Wireless Personal, Local, Metropolitan, and Wide Area Networks 1

CS 758: Cryptography / Network Security

Cryptography and Network Security Department of Computer Science and Engineering Indian Institute of Technology Kharagpur

SECURITY IMPROVMENTS TO THE DIFFIE-HELLMAN SCHEMES

1 Digital Signatures. 1.1 The RSA Function: The eth Power Map on Z n. Crypto: Primitives and Protocols Lecture 6.

CS549: Cryptography and Network Security

Digital Signatures. (Note that authentication of sender is also achieved by MACs.) Scan your handwritten signature and append it to the document?

Outline. CSc 466/566. Computer Security. 8 : Cryptography Digital Signatures. Digital Signatures. Digital Signatures... Christian Collberg

Cryptography and Network Security

2. Cryptography 2.4 Digital Signatures

Digital Signatures. Meka N.L.Sneha. Indiana State University. October 2015

CS549: Cryptography and Network Security

Public Key Cryptography: RSA and Lots of Number Theory

SECURITY IN NETWORKS

Cryptography and Network Security Chapter 10

Module: Applied Cryptography. Professor Patrick McDaniel Fall CSE543 - Introduction to Computer and Network Security

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

CS 348: Computer Networks. - Security; 30 th - 31 st Oct Instructor: Sridhar Iyer IIT Bombay

CPSC 467b: Cryptography and Computer Security

Software Implementation of Gong-Harn Public-key Cryptosystem and Analysis

The application of prime numbers to RSA encryption

Cryptography and Network Security Digital Signature

Cryptography & Digital Signatures

Crittografia e sicurezza delle reti. Digital signatures- DSA

DIGITAL SIGNATURES 1/1

Network Security. Abusayeed Saifullah. CS 5600 Computer Networks. These slides are adapted from Kurose and Ross 8-1

Discrete logarithms within computer and network security Prof Bill Buchanan, Edinburgh Napier

SFWR ENG 4C03 - Computer Networks & Computer Security

CIS 433/533 - Computer and Network Security Public Key Crypto/ Cryptographic Protocols

Secure File Transfer Using USB

Public-Key Cryptanalysis

Study of algorithms for factoring integers and computing discrete logarithms

A SOFTWARE COMPARISON OF RSA AND ECC

Introduction. Digital Signature

Chapter 11 Security+ Guide to Network Security Fundamentals, Third Edition Basic Cryptography

How To Know If A Message Is From A Person Or A Machine

EXAM questions for the course TTM Information Security June Part 1

Symmetric Key cryptosystem

Cryptography: Authentication, Blind Signatures, and Digital Cash

Communications security

Implementation and Comparison of Various Digital Signature Algorithms. -Nazia Sarang Boise State University

Chapter 10. Network Security

IT Networks & Security CERT Luncheon Series: Cryptography

Cryptographic hash functions and MACs Solved Exercises for Cryptographic Hash Functions and MACs

Kleptography: The unbearable lightness of being mistrustful

Discrete Mathematics, Chapter 4: Number Theory and Cryptography

Advanced Cryptography

Evaluation of Digital Signature Process

Security and Authentication Primer

Introduction to Computer Security

CS Computer Security Third topic: Crypto Support Sys

Transcription:

CS 361S Overview of Public-Key Cryptography Vitaly Shmatikov slide 1

Reading Assignment Kaufman 6.1-6 slide 2

Public-Key Cryptography public key public key? private key Alice Bob Given: Everybody knows Bob s public key - How is this achieved in practice? Only Bob knows the corresponding private key Goals: 1. Alice wants to send a message that only Bob can read 2. Bob wants to send a message that only Bob could have written slide 3

Applications of Public-Key Crypto Encryption for confidentiality Anyone can encrypt a message With symmetric crypto, must know the secret key to encrypt Only someone who knows the private key can decrypt Secret keys are only stored in one place Digital signatures for authentication Only someone who knows the private key can sign Session key establishment Exchange messages to create a secret session key Then switch to symmetric cryptography (why?) slide 4

Public-Key Encryption Key generation: computationally easy to generate a pair (public key PK, private key SK) Encryption: given plaintext M and public key PK, easy to compute ciphertext C=E PK (M) Decryption: given ciphertext C=E PK (M) and private key SK, easy to compute plaintext M Infeasible to learn anything about M from C without SK Trapdoor function: Decrypt(SK,Encrypt(PK,M))=M slide 5

Some Number Theory Facts Euler totient function (n) where n 1 is the number of integers in the [1,n] interval that are relatively prime to n Two numbers are relatively prime if their greatest common divisor (gcd) is 1 Euler s theorem: if a Z n *, then a (n) 1 mod n Special case: Fermat s Little Theorem if p is prime and gcd(a,p)=1, then a p-1 1 mod p slide 6

RSA Cryptosystem Key generation: Generate large primes p, q At least 2048 bits each need primality testing! Compute n=pq Note that (n)=(p-1)(q-1) Choose small e, relatively prime to (n) [Rivest, Shamir, Adleman 1977] Typically, e=3 (may be vulnerable) or e=2 16 +1=65537 (why?) Compute unique d such that ed 1 mod (n) Public key = (e,n); private key = d Encryption of m: c = m e mod n Decryption of c: c d mod n = (m e ) d mod n = m slide 7

Why RSA Decryption Works e d 1 mod (n) Thus e d = 1+k (n) = 1+k(p-1)(q-1) for some k If gcd(m,p)=1, then by Fermat s Little Theorem, m p-1 1 mod p Raise both sides to the power k(q-1) and multiply by m, obtaining m 1+k(p-1)(q-1) m mod p Thus m ed m mod p By the same argument, m ed m mod q Since p and q are distinct primes and p q=n, m ed m mod n slide 8

Why Is RSA Secure? RSA problem: given c, n=pq, and e such that gcd(e,(p-1)(q-1))=1, find m such that m e =c mod n In other words, recover m from ciphertext c and public key (n,e) by taking e th root of c modulo n There is no known efficient algorithm for doing this Factoring problem: given positive integer n, find primes p 1,, p k such that n=p 1 e1p 2 e2 p k ek If factoring is easy, then RSA problem is easy, but may be possible to break RSA without factoring n slide 9

Textbook RSA Is Bad Encryption Deterministic Attacker can guess plaintext, compute ciphertext, and compare for equality If messages are from a small set (for example, yes/no), can build a table of corresponding ciphertexts Can tamper with encrypted messages Take an encrypted auction bid c and submit c(101/100) e mod n instead Does not provide semantic security (security against chosen-plaintext attacks) slide 10

Integrity in RSA Encryption Textbook RSA does not provide integrity Given encryptions of m 1 and m 2, attacker can create encryption of m 1 m 2 (m 1e ) (m 2e ) mod n (m 1 m 2 ) e mod n Attacker can convert m into m k without decrypting (m e ) k mod n (m k ) e mod n In practice, OAEP is used: instead of encrypting M, encrypt M G(r) ; r H(M G(r)) r is random and fresh, G and H are hash functions Resulting encryption is plaintext-aware: infeasible to compute a valid encryption without knowing plaintext if hash functions are good and RSA problem is hard slide 11

Digital Signatures: Basic Idea public key public key? private key Alice Bob Given: Everybody knows Bob s public key Only Bob knows the corresponding private key Goal: Bob sends a digitally signed message 1. To compute a signature, must know the private key 2. To verify a signature, only the public key is needed slide 12

RSA Signatures Public key is (n,e), private key is d To sign message m: s = hash(m) d mod n Signing and decryption are the same mathematical operation in RSA To verify signature s on message m: s e mod n = (hash(m) d ) e mod n = hash(m) Verification and encryption are the same mathematical operation in RSA Message must be hashed and padded (why?) slide 13

Digital Signature Algorithm (DSA) U.S. government standard (1991-94) Modification of the ElGamal signature scheme (1985) Key generation: Generate large primes p, q such that q divides p-1 2 159 < q < 2 160, 2 511+64t < p < 2 512+64t where 0 t 8 Select h Z p * and compute g=h (p-1)/q mod p Select random x such 1 x q-1, compute y=g x mod p Public key: (p, q, g, g x mod p), private key: x Security of DSA requires hardness of discrete log If one can take discrete logarithms, then can extract x (private key) from g x mod p (public key) slide 14

DSA: Signing a Message r = (g k mod p) mod q Private key Random secret between 0 and q (r,s) is the signature on M Message Hash function (SHA-1) s = k -1 (H(M)+x r) mod q slide 15

DSA: Verifying a Signature Public key Message Compute (g H(M )w y r w mod q mod p) mod q Signature w = s -1 mod q If they match, signature is valid slide 16

Why DSA Verification Works If (r,s) is a valid signature, then r (g k mod p) mod q ; s k -1 (H(M)+x r) mod q Thus H(M) -x r+k s mod q Multiply both sides by w=s -1 mod q H(M) w + x r w k mod q Exponentiate g to both sides (g H(M) w + x r w g k ) mod p mod q In a valid signature, g k mod p mod q = r, g x mod p = y Verify g H(M) w y r w r mod p mod q slide 17

Security of DSA Can t create a valid signature without private key Can t change or tamper with signed message If the same message is signed twice, signatures are different Each signature is based in part on random secret k Secret k must be different for each signature! If k is leaked or if two messages re-use the same k, attacker can recover secret key x and forge any signature from then on slide 18

PS3 Epic Fail Sony uses ECDSA algorithm to sign authorized software for Playstation 3 Basically, DSA based on elliptic curves with the same random value in every signature Trivial to extract master signing key and sign any homebrew software perfect jailbreak for PS3 Announced by George Geohot Hotz and Fail0verflow team in Dec 2010 Q: Why didn t Sony just revoke the key? slide 19

Diffie-Hellman Protocol Alice and Bob never met and share no secrets Public info: p and g p is a large prime number, g is a generator of Z p * Z p *={1, 2 p-1}; a Z p * i such that a=g i mod p Pick secret, random X Pick secret, random Y g x mod p g y mod p Alice Compute k=(g y ) x =g xy mod p Bob Compute k=(g x ) y =g xy mod p slide 20

Why Is Diffie-Hellman Secure? Discrete Logarithm (DL) problem: given g x mod p, it s hard to extract x There is no known efficient algorithm for doing this This is not enough for Diffie-Hellman to be secure! Computational Diffie-Hellman (CDH) problem: given g x and g y, it s hard to compute g xy mod p unless you know x or y, in which case it s easy Decisional Diffie-Hellman (DDH) problem: given g x and g y, it s hard to tell the difference between g xy mod p and g r mod p where r is random slide 21

Properties of Diffie-Hellman Assuming DDH problem is hard, Diffie-Hellman protocol is a secure key establishment protocol against passive attackers Eavesdropper can t tell the difference between the established key and a random value Can use the new key for symmetric cryptography Basic Diffie-Hellman protocol does not provide authentication IPsec combines Diffie-Hellman with signatures, anti-dos cookies, etc. slide 22

Advantages of Public-Key Crypto Confidentiality without shared secrets Very useful in open environments Can use this for key establishment, avoiding the chicken-or-egg problem With symmetric crypto, two parties must share a secret before they can exchange secret messages Authentication without shared secrets Encryption keys are public, but must be sure that Alice s public key is really her public key This is a hard problem Often solved using public-key certificates slide 23

Disadvantages of Public-Key Crypto Calculations are 2-3 orders of magnitude slower Modular exponentiation is an expensive computation Typical usage: use public-key cryptography to establish a shared secret, then switch to symmetric crypto SSL, IPsec, most other systems based on public crypto Keys are longer 2048 bits (RSA) rather than 128 bits (AES) Relies on unproven number-theoretic assumptions Factoring, RSA problem, discrete logarithm problem, decisional Diffie-Hellman problem slide 24