Introduction to Cryptography David Brumley Carnegie Mellon University Credits: Many slides from Dan Boneh’s June 2012 Coursera crypto.

Slides:



Advertisements
Similar presentations
Public Key Cryptography Nick Feamster CS 6262 Spring 2009.
Advertisements

Online Cryptography Course Dan Boneh
Cryptography: Review Day David Brumley Carnegie Mellon University.
CS 6262 Spring 02 - Lecture #7 (Tuesday, 1/29/2002) Introduction to Cryptography.
Cryptography: The Landscape, Fundamental Primitives, and Security David Brumley Carnegie Mellon University.
1 Introduction CSE 5351: Introduction to cryptography Reading assignment: Chapter 1 of Katz & Lindell.
Lecture 2.1: Private Key Cryptography -- I CS 436/636/736 Spring 2013 Nitesh Saxena.
15-1 Last time Internet Application Security and Privacy Public-key encryption Integrity.
Session 5 Hash functions and digital signatures. Contents Hash functions – Definition – Requirements – Construction – Security – Applications 2/44.
CS 555Topic 11 Cryptography CS 555 Topic 1: Overview of the Course & Introduction to Encryption.
Feb 25, 2003Mårten Trolin1 Previous lecture More on hash functions Digital signatures Message Authentication Codes Padding.
CMSC 414 Computer and Network Security Lecture 6 Jonathan Katz.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
CMSC 414 Computer (and Network) Security Lecture 2 Jonathan Katz.
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
Asymmetric Cryptography part 1 & 2 Haya Shulman Many thanks to Amir Herzberg who donated some of the slides from
Mar 5, 2002Mårten Trolin1 Previous lecture More on hash functions Digital signatures Message Authentication Codes Padding.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
Introduction to Modern Cryptography Instructor: Amos Fiat Strongly based on presentation and class by Benny Chor School of Computer Science Tel- Aviv Univ.
Intro To Encryption Exercise 1. Monoalphabetic Ciphers Examples:  Caesar Cipher  At Bash  PigPen (Will be demonstrated)  …
1 Chap 1: Introduction Some background –The message is usually represented as M or P (plaintext), the encryption result is usually represented as C (ciphertext).
CS1001 Lecture 24. Overview Encryption Encryption Artificial Intelligence Artificial Intelligence Homework 4 Homework 4.
Overview of Cryptography and Its Applications Dr. Monther Aldwairi New York Institute of Technology- Amman Campus INCS741: Cryptography.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Computer Security CS 426 Lecture 3
Encryption. Introduction Computer security is the prevention of or protection against –access to information by unauthorized recipients –intentional but.
CMSC 414 Computer and Network Security Lecture 3 Jonathan Katz.
Dan Boneh Introduction Course Overview Online Cryptography Course Dan Boneh.
Dan Boneh Stream ciphers The One Time Pad Online Cryptography Course Dan Boneh.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2014 Nitesh Saxena.
Cryptography Lecture 8 Stefan Dziembowski
13-1 Last time Security in Networks Network Security Controls Firewalls Honeypots Intrusion Detection Systems.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
Symmetric versus Asymmetric Cryptography. Why is it worth presenting cryptography? Top concern in security Fundamental knowledge in computer security.
Cryptography, Authentication and Digital Signatures
Network Security Section 1: Introduction to security.
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
Lecture 3.4: Public Key Cryptography IV CS 436/636/736 Spring 2013 Nitesh Saxena.
Cryptography Wei Wu. Internet Threat Model Client Network Not trusted!!
Attacks on OTP and stream ciphers
Classical Crypto By: Luong-Sorin VA, IMIT Dith Nimol, IMIT.
Lecture 2: Introduction to Cryptography
Cryptography 1 Crypto Cryptography 2 Crypto  Cryptology  The art and science of making and breaking “secret codes”  Cryptography  making “secret.
Overview of Cryptography & Its Applications
Cryptography: The Landscape, Fundamental Primitives, and Security David Brumley Carnegie Mellon University.
Cryptography: Review Day David Brumley Carnegie Mellon University.
CS555Spring 2012/Topic 31 Cryptography CS 555 Topic 3: One-time Pad and Perfect Secrecy.
Dan Boneh Introduction Course Overview Online Cryptography Course Dan Boneh.
MM Clements Cryptography. Last Week Firewalls A firewall cannot protect against poor server, client or network configuration A firewall cannot.
Introduction to Cryptography
CS526Topic 2: Classical Cryptography1 Information Security CS 526 Topic 2 Cryptography: Terminology & Classic Ciphers.
Cryptographic Security Aveek Chakraborty CS5204 – Operating Systems1.
Cryptography Lecture 3 Arpita Patra © Arpita Patra.
1 Introduction CS 303 Algorithmic Number Theory and Cryptography Jeremy R. Johnson.
Computer Security By Rubel Biswas. Introduction History Terms & Definitions Symmetric and Asymmetric Attacks on Cryptosystems Outline.
CMSC 414 Computer and Network Security Lecture 2 Jonathan Katz.
หัวข้อบรรยาย Stream cipher RC4 WEP (in)security LFSR CSS (in)security.
B504/I538: Introduction to Cryptography
Cryptography Lecture 4.
Encryption NSA – used to be able to crack most codes, technology has changed that Encryption is the art of encoding messages so they can’t be understood.
Topic 3: Perfect Secrecy
Security through Encryption
Introduction to Symmetric-key and Public-key Cryptography
Encryption NSA – used to be able to crack most codes, technology has changed that. Now other methods are applied by NSA to access transmissions (see 2013.
Encryption NSA – used to be able to crack most codes, technology has changed that Encryption is the art of encoding messages so they can’t be understood.
Cryptography Lecture 3.
Presentation transcript:

Introduction to Cryptography David Brumley Carnegie Mellon University Credits: Many slides from Dan Boneh’s June 2012 Coursera crypto class, which is great!

Cryptography is Everywhere Secure communication: – web traffic: HTTPS – wireless traffic: i WPA2 (and WEP), GSM, Bluetooth Encrypting files on disk: EFS, TrueCrypt Content protection: – CSS (DVD), AACS (Blue-Ray) User authentication – Kerberos, HTTP Digest … and much much more 2

3 Alice Bob message m = “I {Love,Hate} you” Public Channel Eve Eve is a very powerful, smart person (say any polynomial time alg) E D cc Goal: Protect Alice’s Communications with Bob

History of Cryptography 4 David Kahn, “The code breakers” (1996)

Caesar Cipher: c = m Julius Caesar 100 BC- 44 BC A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

How would you attack messages encrypted with a substitution cipher? 6

Attacking Substitution Ciphers 7 Trick 2: Letter Frequency Trick 2: Letter Frequency Most common: e,t,a,o,i,n Least common: j,x,q,z image source: wikipedia Trick 1: Word Frequency Trick 1: Word Frequency

Jvl mlwclk yr jvl owmwez twp yusl w zyduo pjdcluj mqil zydkplmr. Hdj jvlz tykilc vwkc jy mlwku jvl wkj yr vwsiquo, tvqsv vlmflc mlwc jvlg jy oklwjulpp. Zyd vwnl jvl fyjlujqwm jy cy jvl pwgl. Zydk plsklj fwpptykc qp: JYWPJ 8

Classical Approach: Iterated Design Scheme 1Broken Scheme 2 Broken Scheme 3 Deploy... Broken No way to say anything is secure (and you may not know when broken) 9

Iterated design was only one we knew until Claude Shannon:

Claude Shannon Formally define: – security goals – adversarial models – security of system wrt goals Beyond iterated design: Proof! 11

Cryptosystem m keke c m or error c’ 12 AliceE BobD keke

Symmetric Cryptography 13 k = k e = k d Everyone who knows k knows the full secret m keke c m or error c’ AliceE BobD keke

Asymmetric Cryptography 14 k e != k d Encryption Example: – Alice generates private (K d )/public(K d ) keypair. Sends bob public key – To encrypt a message to Alice, Bob computes c = E(m,K e ) – To decrypt, Alice computes m = D(m, K d ) m keke c m or error c’ AliceE BobD keke

But all is not encryption Message Authentication Code: Only people with the private key k could have sent the message. 15 Message m “I love you, Bob” s = Sign(m, K sign ) Alice Bob S V m||s Verify(m, s, K verify ) =?= true Eve (tries to alter m without detection)

An interesting story... 16

1974 A student enrolls in the Computer Security Stanford Proposes idea for public key crypto. Professor shoots it down 17 Picture:

1975 Submits a paper to the Communications of the ACM “I am sorry to have to inform you that the paper is not in the main stream of present cryptography thinking and I would not recommend that it be published in the Communications of the ACM. Experience shows that it is extremely dangerous to transmit key information in the clear." 18

Today Ralph Merkle: A Father of Cryptography 19 Picture:

Covered in this class Symmetric Trust ModelAsymmetric Trust Model Message PrivacyPrivate key encryption Stream Ciphers Block Ciphers Asymmetric encryption (aka public key) Message Authenticity and Integrity Message Authenticity Code (MAC) Digital Signature Scheme 20 everyone shares same secret k Only 1 party has a secret Principle 1: All algorithms public Principle 2: Security is determined only by key size Principle 3: If you roll your own, it will be insecure

Cryptonium Pipe Security Goals 21 Alice Bob Public Channel Eve E D cc’ One Goal: Privacy Eve should not be able to learn m. m keke m or error keke

Not even 1 bit... Suppose there are two possible messages that differ on one bit, e.g., whether Alice Loves or Hates Bob. Privacy means Eve still should not be able to determine which message was sent. 22 AliceBob M = “I {Love,Hate} you” Eve Security guarantees should hold for all messages, not just a particular kind of message.

Eve’s Powers Ciphertext Only Known Plaintext Attack (KPA) Chosen Plaintext Attack (CPA) Known Ciphertext Attack (KCA) Chosen Ciphertext Attack (CCA) 23 AliceBob Eve

Symmetric Cryptography Defn: A symmetric key cipher consists of 3 polynomial time algorithms: 1.KeyGen(l): A randomized algorithm that returns a key of length l. l is called the security parameter. 2.E(k,m): A potentially randomized alg. that encrypts m with k. It returns a c in C 3.D(k,c): An always deterministic alg. that decrypts c with key k. It returns an m in M. And (correctness condition) 24 Type Signature

The One Time Pad 25 Miller, 1882 and Vernam, 1917 m: k: c: k: m: M = C = K = {0,1} n

The One Time Pad 26 Miller, 1882 and Vernam, 1917 Is it a cipher? Efficient Correct

Question Given m and c encrypted with an OTP, can you compute the key? 1.No 2.Yes, the key is k = m ⊕ c 3.I can only compute half the bits 4.Yes, the key is k = m ⊕ m 27

Perfect Secrecy [Shannon1945] (Information Theoretic Secrecy) Defn Perfect Secrecy (informal): We’re no better off determining the plaintext when given the ciphertext. 28 AliceBob Eve 1.Eve observes everything but the c. Guesses m 1 2.Eve observes c. Guesses m 2 Goal:

Example Suppose there are 3 possible messages Alice may send: m 1 : The attack is at 1pm. The probability of this message is 1/2 m 2 : The attack is at 2pm. The probability of this message is 1/4 m 3 : The attack is at 3pm. The probability of this message is 1/4 29 AliceBob Eve Mm1m1 m2m2 m3m3 Pr[M=m]½¼1/4

Perfect Secrecy [Shannon1945] (Information Theoretic Secrecy) Defn Perfect Secrecy (formal): 30

Question How many OTP keys map m to c? Depends on m 31

Good News: OTP has Perfect Secrecy Thm: The One Time Pad is Perfectly Secure Must show: where |M| = {0,1} m Intuition: Say that M = {00,01,10,11}, and m = 11. The adversary receives c = 10. It asks itself whether the plaintext was m 0 or m 1 (e.g., 01 or 10). It reasons: if m 0, then k = m 0  c = 01  10 = 11. if m 1, then k = m 1  c = 10  10 = 00. But all keys are equally likely, so it doesn’t know which case it could be. 32 \begin{align} \Pr[E(k,m_0) = c] &= \Pr[k \oplus m_0 = c] \\ & = \frac{|k \in \{0,1\}^m : k \oplus m_0 = c|}{\{0,1\}^m}\\ & = \frac{1}{2^m}\\ \Pr[E(k,m_1) = c] &= \Pr[k \oplus m_1 = c] \\ & = \frac{|k \in \{0,1\}^m : k \oplus m_1 = c|}{\{0,1\}^m}\\ & = \frac{1}{2^m} \end{align} Therefore, $\Pr[E(k,m_0) = c] = \Pr[E(k,m_1) = c]$

Good News: OTP has Perfect Secrecy Thm: The One Time Pad is Perfectly Secure Must show: where |M| = |K| = {0,1} m Proof: 33 \begin{align} \Pr[E(k,m_0) = c] &= \Pr[k \oplus m_0 = c] \\ & = \frac{|k \in \{0,1\}^m : k \oplus m_0 = c|}{\{0,1\}^m}\\ & = \frac{1}{2^m}\\ \Pr[E(k,m_1) = c] &= \Pr[k \oplus m_1 = c] \\ & = \frac{|k \in \{0,1\}^m : k \oplus m_1 = c|}{\{0,1\}^m}\\ & = \frac{1}{2^m} \end{align} Therefore, $\Pr[E(k,m_0) = c] = \Pr[E(k,m_1) = c]$

Two Time Pad is Insecure Two Time Pad: c 1 = m 1  k c 2 = m 2  k Eavesdropper gets c 1 and c 2. What is the problem? 34 Enough redundancy in ASCII (and english) that m 1  m 2 is enough to know m 1 and m 2 Enough redundancy in ASCII (and english) that m 1  m 2 is enough to know m 1 and m 2 c 1  c 2 = m 1  m 2

All keys must be equally likely Let M={000,001} Let K = {000, 001, 010, 011, 100, 101, 110, 111} Note that if K is randomly selected as 000, then M = C. This is not a weakness! If we did not allow a message to encrypt to itself, then some ciphertexts are more likely, which is bad. 35 Two possible messages 8 keys

The “Bad News” Theorem Theorem: Perfect secrecy requires |K| >= |M| 36 In practice, we usually shoot for computational security.

The OTP provides perfect secrecy But is that enough? 37

No Integrity 38 m enc ( ⊕k ) m ⊕ k m ⊕ k ⊕ evilm ⊕ evil dec ( ⊕k ) ? ⊕ evil ? Eve

No Integrity 39 From: Bob enc ( ⊕k ) From: Bob From: Eve dec ( ⊕k ) ⊕ Eve

Security Goals 40 Alice Bob Public Channel Eve E D cc’ m keke m or error keke read/write access Goal 2: Integrity Eve should not be able to alter m without detection.

Detecting Flipped Bits Bob should be able to determine if M=M’ Ex: Eve should not be able to flip Alice’s message without detection (even when Eve doesn’t know content of M) 41 AliceBob M = “I {Love,Hate} you” Eve (read/write) Receives M’

42 Goal 3: Authenticity Eve should not be able to forge messages as Alice Alice Bob Public Channel Eve E D cc’ m keke m or error keke read/write access

Detecting Flipped Bits Bob should be able to determine M wasn’t sent from Alice 43 AliceBob M = “I Love you, signed Alice” Eve (read/write)

Cryptonium Pipe Goals: Privacy, Integrity, and Authenticity 44 Alice Bob Public Channel Eve E D cc’ m keke m or error keke read/write access

Summary Cryptography is a awesome tool – But not a complete solution to security – Authenticity, Integrity, Secrecy Perfect secrecy and OTP – Good news and Bad News 45

46 Questions?