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



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

Lecture 6 - Cryptography

CSCE 465 Computer & Network Security

Overview of Public-Key Cryptography

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

Public Key (asymmetric) Cryptography

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

CIS433/533 - Computer and Network Security Cryptography

Part 2 D(E(M, K),K ) E(M, K) E(M, K) Plaintext M. Plaintext M. Decrypt with private key. Encrypt with public key. Ciphertext

Cryptography and Network Security

SECURITY IMPROVMENTS TO THE DIFFIE-HELLMAN SCHEMES

Overview of Cryptographic Tools for Data Security. Murat Kantarcioglu

Notes on Network Security Prof. Hemant K. Soni

Public Key Cryptography Overview

Modeling and verification of security protocols

The Mathematics of the RSA Public-Key Cryptosystem

Elements of Applied Cryptography Public key encryption

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

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

CS 758: Cryptography / Network Security

RSA Attacks. By Abdulaziz Alrasheed and Fatima

Network Security. HIT Shimrit Tzur-David

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

CRYPTOGRAPHY IN NETWORK SECURITY

CPSC 467b: Cryptography and Computer Security

CIS 5371 Cryptography. 8. Encryption --

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

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

Chapter 10. Network Security

Common Pitfalls in Cryptography for Software Developers. OWASP AppSec Israel July The OWASP Foundation

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

Cryptography and Network Security

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

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

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

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

Q: Why security protocols?

Authentication Types. Password-based Authentication. Off-Line Password Guessing

Schnorr Signcryption. Combining public key encryption with Schnorr digital signature. Laura Savu, University of Bucharest, Romania

Cryptography and Network Security Chapter 9

2.4: Authentication Authentication types Authentication schemes: RSA, Lamport s Hash Mutual Authentication Session Keys Trusted Intermediaries

Secure File Transfer Using USB

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

Cryptography and Network Security Chapter 10

Client Server Registration Protocol

Secure Network Communications FIPS Non Proprietary Security Policy

CSC474/574 - Information Systems Security: Homework1 Solutions Sketch

SFWR ENG 4C03 - Computer Networks & Computer Security

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

SECURITY IN NETWORKS

Chapter 7: Network security

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

7! Cryptographic Techniques! A Brief Introduction

Key Management. CSC 490 Special Topics Computer and Network Security. Dr. Xiao Qin. Auburn University

TELE 301 Network Management. Lecture 18: Network Security

Computer Security: Principles and Practice

Cryptography: RSA and Factoring; Digital Signatures; Ssh

Computer Networks. Network Security and Ethics. Week 14. College of Information Science and Engineering Ritsumeikan University

Public Key Cryptography and RSA. Review: Number Theory Basics

Software Tool for Implementing RSA Algorithm

Public Key Cryptography: RSA and Lots of Number Theory

CS Computer Security Third topic: Crypto Support Sys

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

Network Security Technology Network Management

Network Security CS 5490/6490 Fall 2015 Lecture Notes 8/26/2015

Security Sensor Network. Biswajit panja

Module 8. Network Security. Version 2 CSE IIT, Kharagpur

Practice Questions. CS161 Computer Security, Fall 2008

The Misuse of RC4 in Microsoft Word and Excel

YALE UNIVERSITY DEPARTMENT OF COMPUTER SCIENCE

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

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

Name: 1. CSE331: Introduction to Networks and Security Fall 2003 Dec. 12, /14 2 /16 3 /16 4 /10 5 /14 6 /5 7 /5 8 /20 9 /35.

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

Lecture 9: Application of Cryptography

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

Transitions: Recommendation for Transitioning the Use of Cryptographic Algorithms and Key Lengths

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

Cryptography and Network Security: Summary

EXAM questions for the course TTM Information Security June Part 1

Cryptography: Authentication, Blind Signatures, and Digital Cash

How To Encrypt Data With Encryption

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

Network Security (2) CPSC 441 Department of Computer Science University of Calgary

Lecture 9 - Network Security TDTS (ht1)

Lecture Note 5 PUBLIC-KEY CRYPTOGRAPHY. Sourav Mukhopadhyay

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

Kleptography: The unbearable lightness of being mistrustful

Module 7 Security CS655! 7-1!

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

A SOFTWARE COMPARISON OF RSA AND ECC

Lukasz Pater CMMS Administrator and Developer

OPENID AUTHENTICATION SECURITY

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

QUANTUM COMPUTERS AND CRYPTOGRAPHY. Mark Zhandry Stanford University

Capture Resilient ElGamal Signature Protocols

Massachusetts Institute of Technology Handout : Network and Computer Security October 9, 2003 Professor Ronald L. Rivest.

Cryptography and Network Security

EXAM questions for the course TTM Information Security May Part 1

How To Understand And Understand The History Of Cryptography

Transcription:

CIS 433/533 - Computer and Network Security Public Key Crypto/ Cryptographic Protocols Professor Kevin Butler Winter 2010 Computer and Information Science

Key Distribution/Agreement Key Distribution is the process where we assign and transfer keys to a participant Out of band (e.g., passwords, simple) During authentication (e.g., Kerberos) As part of communication (e.g., skip-encryption) Key Agreement is the process whereby two parties negotiate a key 2 or more participants Typically, key distribution/agreement this occurs in conjunction with or after authentication. However, many applications can pre-load keys 2

Key Distribution Say we used pairwise key distribution/agreement in this class (strictly symmetric cryptography) Q: how many key negotiations would there be? 36481 ASes in the Internet: how many negotiations for secure routing solutions? 3

Diffie-Hellman Key Agreement The DH paper really started the modern age of cryptography, and indirectly the security community Negotiate a secret over an insecure media E.g., in the clear (seems impossible) Idea: participants exchange intractable puzzles that can be solved easily with additional information Mathematics are very deep Working in multiplicative group G Use the hardness of computing discrete logarithms in finite field to make secure Things like RSA are variants that exploit similar properties 4

Definitions (Num. Theory) Field: set of numbers closed under addition and multiplication (also associative and commutative) Finite Field: field with finite elements: a set of numbers modulo p Multiplicative Group modulo p: finite field plus multiplication operation (numbers 1,... p-1) Subgroup: some elements of a group: if group operation applied, element still in subgroup e.g., additive group mod 8, set {0, 2, 4, 6} forms subgroup 5

Diffie-Hellman Protocol For two participants p 1 and p 2 Setup: We pick a prime number p and a base g (<p) This information is public E.g., p=23, g=5 Step 1: Each principal picks a private value x (<p-1) Step 2: Each principal generates and communicates a new value y = g x mod p Step 3: Each principal generates the secret shared key z z = y x mod p Perform a neighbor exchange. 6

Diffie-Hellman Params: p=23, g=5 (public values) Alice Bob Private: xa = 6 Private: xb = 15 YA = g x A mod p = 5 6 mod 23 = 8 Z = YB x mod p = 19 6 mod 23 = 2 YB = g x B mod p = 5 15 mod 23 = 19 Z = YA x mod p = 8 15 mod 23 = 2 7

Attacks on Diffie-Hellman This is key agreement, not authentication. You really don t know anything about who you have exchanged keys with The man in the middle A B Alice and Bob think they are talking directly to each other, but Mallory is actually performing two separate exchanges You need to have an authenticated DH exchange e.g., out of band 8

D-H Subtleties Generator: g i generates elements in group Primitive element: there is some i such that g generates all elements in a group Weakness: if g is not a primitive element of the group then only a small subgroup may be generated Solution: safe primes prime p of form 2q +1 where q prime subgroups now {1}, {1, p-1}, size q, size 2q 2, 5 are good values for generators 9

Public Key Cryptography Each key pair consists of a public and private component: k + (public key), k - (private key) D(E(p, k + ),k )=p D(E(p, k ),k + )=p Public keys are distributed (typically) through public key certificates Anyone can communicate secretly with you if they have your certificate E.g., SSL-based web commerce 10

RSA (Rivest, Shamir, Adelman) A dominant public key algorithm The algorithm itself is conceptually simple Why it is secure is very deep (number theory) Use properties of exponentiation modulo a product of large primes A method for obtaining Digital Signatures and Public Key Cryptosystems, Communications of the ACM, Feb., 1978 21(2) pages 120-126. 11

RSA Key Generation Pick two large primes p and q Calculate n = pq Pick e such that it is relatively prime to phi(n) = (q-1)(p-1) Euler s Totient Function d ~= e -1 mod phi(n) de mod phi(n) = 1 or 1. p=3, q=11 2. n = 3*11 = 33 3. phi(n) = (2*10) = 20 4. e = 7 GCD(20,7) = 1 5. Euclid s Algorithm d = 7-1 mod 20 d d7 mod 20 = 1 d = 3 12

RSA Encryption/Decryption Public key k + is {e,n} and private key k - is {d,n} Encryption and Decryption E(k+,P) : ciphertext = plaintext e mod n D(k-,C) : plaintext = ciphertext d mod n Example Public key (7,33), Private Key (3,33) Data 4 (encoding of actual data) E({7,33},4) = 4 7 mod 33 = 16384 mod 33 = 16 D({3,33},16) = 16 3 mod 33 = 4096 mod 33 = 4 13

RSA Recap Pick two primes: p, q Modulus n = pq Euler s totient ϕ(n) = (p-1)(q-1) Public exponent e selected s.t. gcd(e,ϕ(n)) = 1 Private exponent d = e -1 mod ϕ(n) For message m, ciphertext c, plaintext p c = m e (mod n) p = c d (mod n) 14

Encryption using private key Encryption and Decryption E(k -,P) : ciphertext = plaintext d mod n D(k +,C) : plaintext = ciphertext e mod n E.g., E({3,45},4) = 4 3 mod 33 = 64 mod 33 = 31 D({7,45},19) = 31 7 mod 33 = 27,512,614,111 mod 33 = 4 Q: Why encrypt with private key? 15

Textbook RSA Safe to use? NO!! Multiplicative homomorphism For c = E(m) = m e mod(n) E(m1) * E(m2) = E(m1 * m2) Avoid structure by encoding values with PKCS#1 Use different exponents for encryption and signing (typically e=3 for enc., 5 for signing) don t use small d, insecure (small exponent attack) 16

Common Modulus Attack Alice uses n, ea Bob uses n, eb (i.e., share common modulus) If ea and eb are relatively prime then eavesdropper Eve does the following: c a = m e a mod n c b = m e b mod n Use Euclidean algorithm to find r,s where ea*r + eb*s = 1 (the e values are public) Now: (m e a mod n) r (m e b mod n) s = M e a r+e b s mod n = M mod n 17

Digital Signatures Models physical signatures in digital world Association between private key and document and indirectly identity and document. Asserts that document is authentic and non-reputable To sign a document Given document d, private key k- Signature S(d) = E( k -, h(d) ) Validation Given document d, signature S(d), public key k+ Validate D(k +, S(d)) = H(d) 18

Secret vs. public key crypto. Secret key cryptography Symmetric keys, where A single key (k) is used is used for E and D D( E( p, k ), k ) = p All (intended) receivers have access to key Note: Management of keys determines who has access to encrypted data E.g., password encrypted email Also known as symmetric key cryptography Public key cryptography Each key pair consists of a public and private component: k+ (public key), k- (private key) D( E(p, k+), k- ) = p D( E(p, k-), k+ ) = p Public keys are distributed (typically) through public key certificates Anyone can communicate secretly with you if they have your certificate E.g., SSL-based web commerce 19

Meet Alice and Bob. Alice and Bob are the canonical players in the cryptographic world. They represent the end points of some interaction Used to illustrate/define a security protocol Other players occasionally join Trent - trusted third party Mallory - malicious entity Eve - eavesdropper Ivan - an issuer (of some object) 20

Some notation You will generally see protocols defined in terms of exchanges containing some notation like All players are identified by their first initial E.g., Alice=A, Bob=B d is some data pw A is the password for A k AB is a symmetric key known to A and B KA +,KA - is a public/private key pair for entity A E(k,d) is encryption of data d with key k H(d) is the hash of data d Sig(KA -,d) is the signature (using A s private key) of data d + is used to refer to concatenation 21

Some interesting things you want to do when communicating. Ensure the authenticity of a user Ensure the integrity of the data Also called data authenticity Keep data confidential Guarantee non-repudiation 22

Basic (User) Authentication Bob wants to authenticate Alice s identity (is who she says she is) [pw A ] 1 Alice Bob 2 [Y/N] 23

Hash User Authentication Bob wants to authenticate Alice s identity (is who she says she is) [h(pw A )] 1 Alice Bob 2 [Y/N] 24

Challenge/Response User Authentication Bob wants to authenticate Alice s identity (is who she says she is) [c] Alice 2 [h(c+pw A )] 1 Bob 3 [Y/N] 25

User Authentication vs. Data Integrity User authentication proves a property about the communicating parties E.g., I know a password Data integrity ensures that the data transmitted... Can be verified to be from an authenticated user Can be verified to determine whether it has been modified Now, lets talk about the latter, data integrity 26

Simple Data Integrity? Alice wants to ensure any modification of the data in flight is detectable by Bob (integrity) Alice 1 [d,h(d)] Bob 27

HMAC Integrity Alice wants to ensure any modification of the data in flight is detectable by Bob (integrity) Alice 1 [d,hmac(k,d)] Bob 28

Signature Integrity Alice wants to ensure any modification of the data in flight is detectable by Bob (integrity) Alice 1 [d, Sig(K A -, d)] Bob 29

Data Integrity vs. Non-repudiation If the integrity of the data is preserved, is it provably from that source? Hash integrity says what about non-repudiation? Signature integrity says what about non-repudiation? 30

Confidentiality! Alice wants to ensure that the data is not exposed to anyone except the intended recipient (confidentiality) [E(k AB,d), HMAC(k AB, d)] Alice 1 Bob 31

Question If I already have an authenticated channel (e.g., the remote party s public key), why don t I simply make up a key and send it to them? 32

Confidentiality! Alice wants to ensure that the data is not exposed to anyone except the intended recipient (confidentiality)! But, Alice and Bob have never met!!!! [E(k x,d), hmac(k x, d),e(k B +,k x )] Alice 1 Bob! Alice randomly selects key k x to encrypt with 33

Real Systems Security The reality of the security is that 90% of the frequently used protocols use some variant of these constructs. So, get to know them they are your friends We will see them (and a few more) over the term They also apply to systems construction Protocols need not necessarily be online Think about how you would use these constructs to secure files on a disk drive (integrity, authenticity, confidentiality) We will add some other tools, but these are the basics 34

Cryptanalysis and Protocol Analysis Cryptographic Algorithms Complex mathematical concepts May be flawed What approaches are used to prove correct/find flaws? Cryptographic Protocols Complex composition of algorithms and messages May be flawed What approaches are used to prove correct/find flaws? 35

A Protocol Story Needham-Schroeder Public Key Protocol Defined in 1978 Assumed Correct Many years without a flaw being discovered Proven Correct BAN Logic So, It s Correct, Right? 36

Needham-Schroeder Public Key Does It Still Look OK? Nonce Message a.1: A --> B : A,B, {NA, A}PKB A initiates protocol with fresh value for B Message a.2: B --> A : B,A, {NA, NB}PKA B demonstrates knowledge of NA and challenges A Message a.3: A --> B : A,B, {NB}PKB A demonstrates knowledge of NB A and B are the only ones who can read NA and NB 37

Gavin Lowe Attack An active intruder X participates... Message a.1: Message b.1: A --> X : A,X, {NA, A}PKX X(A) --> B : A,B, {NA, A}PKB X as A initiates protocol with fresh value for B Message b.2: Message a.2: B --> X(A) : B,A, {NA, NB}PKA X --> A : X,A, {NA, NB}PKA X asks A to demonstrates knowledge of NB Message a.3: A --> X : A,X, {NB}PKX A tells X NB; thanks A! Message b.3: X(A) --> B : A,B, {NB}PKB X completes the protocol as A 38

What Happened? X can get A to act as an oracle for nonces Hey A, what s the NB in this message from any B? A assumes that any message encrypted for it is legit Bad idea X can enable multiple protocol executions to be interleaved Should be part of the threat model? 39

Dolev-Yao Result Strong attacker model Attacker intercepts every message Attacker can cause one of a set of operators to be applied at any time Operators for modifying, generating any kind of message Attacker can apply any operator except other s decryption Common model to show security against 40

Basic truths of cryptography Cryptography is not frequently the source of security problems Algorithms are well known and widely studied Use of crypto commonly is (e.g., WEP) Vetted through crypto community Avoid any proprietary encryption Claims of new technology or perfect security are almost assuredly snake oil 41

Why Cryptosystems Fail Typically, not because of crypto algorithms 42

ATMs Consider ATM systems some public data, also some high value information banks tend to be interested in security How do they work? Card: with account number User: provides PIN ATM: verifies that PIN corresponds to encryption of account number with PIN key (offset can be used) Foundation of security: PIN key This is a trusted part of the system 43

ATM Fraud Insiders Make extra card; special ops allow debit of any account Outsiders Shoulder surfing; fake ATMs, replay pay response PINs Weak entropy of PIN keys; limit user PIN choices; same PIN for everyone User-chosen PINs Bad; Store encrypted in a file (find match); Encrypted on card 44

Fake & Compromised ATMs China, 2010: fake ATMs that look real but give error messages when a card put in Russia: March 2009 criminals install a Trojan on Diebold ATMs Skimmer-A code steals PINs from cards entered in machine and skims money in a variety of currencies 45

More Complex Issues PIN key derivation Set terminal key from two shares Download PIN key encrypted under terminal key Other banks PIN keys Encrypt working keys under a zone key Re-encrypt under ATM bank s working key Must keep all these keys secret 46

Product Insecurity Despite well understood crypto foundations, products don t always work securely Lose secrets due to encryption in software Incompatibilities (borrow my terminal) Poor product design Back doors enabled, non-standard crypto, lack of entropy, etc. Sloppy operations Ignore attack attempts, share keys, procedures are not defined or followed Cryptanalysis sometimes Home-grown algorithms!, improper parameters, cracking DES 47

Problems Systems may work in general, but... Are difficult to use in practice Counter-intuitive Rewards aren t clear Correct usage is not clear Too many secrets ultimately Fundamentally, two problems Too complex to use No way to determine if use is correct 48

Solutions? Suggestions from Anderson: Determine exactly what can go wrong Find all possible failure modes Put in safeguards Describe how preventions protect system Correct implementation of safeguards Implementation of preventions meets requirements Decisions left to people are small in number and clearly understood People know what to do These are general problems of security! 49

System Design Principles Don t design your own crypto algorithm Use standards whenever possible Make sure you understand parameter choices Make sure you understand algorithm interactions E.g. the order of encryption and authentication (in certain instances, authenticate then encrypt is risky) Be open with your design Solicit feedback Use open algorithms and protocols Open code? (jury is still out) 50

Common issues that lead to pitfalls Generating randomness Storage of secret keys Virtual memory (pages secrets onto disk) Protocol interactions Poor user interface Poor choice of key length, prime length, using parameters from one algorithm in another 51