Public Key Encryption CS432 – Security in Computing Copyright © 2005, 2008 by Scott Orr and the Trustees of Indiana University.

Slides:



Advertisements
Similar presentations
Chapter 3 Public Key Cryptography and Message authentication.
Advertisements

Hash Functions A hash function takes data of arbitrary size and returns a value in a fixed range. If you compute the hash of the same data at different.
Spring 2000CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
Public Key Encryption Algorithm
CC3.12 Erdal KOSE Privacy & Digital Security Encryption.
ECOMMERCE TECHNOLOGY SUMMER 2002 COPYRIGHT © 2002 MICHAEL I. SHAMOS Cryptographic Security.
Dr Alejandra Flores-Mosri Message Authentication Internet Management & Security 06 Learning outcomes At the end of this session, you should be able to:
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Cryptography.
Kemal AkkayaWireless & Network Security 1 Department of Computer Science Southern Illinois University Carbondale CS 591 – Wireless & Network Security Lecture.
Henric Johnson1 Chapter3 Public-Key Cryptography and Message Authentication Henric Johnson Blekinge Institute of Technology, Sweden
Cryptography (continued). Enabling Alice and Bob to Communicate Securely m m m Alice Eve Bob m.
WS Algorithmentheorie 03 – Randomized Algorithms (Public Key Cryptosystems) Prof. Dr. Th. Ottmann.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Cryptography1 CPSC 3730 Cryptography Chapter 9 Public Key Cryptography and RSA.
Chapter3 Public-Key Cryptography and Message Authentication.
Chapter 3 Encryption Algorithms & Systems (Part C)
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Chapter 3 Encryption Algorithms & Systems (Part B)
Public Key Cryptography RSA Diffie Hellman Key Management Based on slides by Dr. Lawrie Brown of the Australian Defence Force Academy, University College,
SCSC 455 Computer Security
CN8816: Network Security1 Confidentiality, Integrity & Authentication Confidentiality - Symmetric Key Encryption Data Integrity – MD-5, SHA and HMAC Public/Private.
Public Key Encryption and the RSA Public Key Algorithm CSCI 5857: Encoding and Encryption.
 Introduction  Requirements for RSA  Ingredients for RSA  RSA Algorithm  RSA Example  Problems on RSA.
1 Fluency with Information Technology Lawrence Snyder Chapter 17 Privacy & Digital Security Encryption.
1 Public-Key Cryptography and Message Authentication Ola Flygt Växjö University, Sweden
Page 1 Secure Communication Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation.
Lecture 15 Lecture’s outline Public algorithms (usually) that are each other’s inverse.
Network Security. An Introduction to Cryptography The encryption model (for a symmetric-key cipher).
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Network Security (A Very Brief Introduction)
Electronic Mail Security
1 Network Security Lecture 6 Public Key Algorithms Waleed Ejaz
RSA Ramki Thurimella.
10/1/2015 9:38:06 AM1AIIS. OUTLINE Introduction Goals In Cryptography Secrete Key Cryptography Public Key Cryptograpgy Digital Signatures 2 10/1/2015.
Encryption Coursepak little bit in chap 10 of reed.
Public-Key Cryptography CS110 Fall Conventional Encryption.
Networks Management and Security Lecture 3.
Midterm Review Cryptography & Network Security
CS526: Information Security Prof. Sam Wagstaff September 16, 2003 Cryptography Basics.
4 th lecture.  Message to be encrypted: HELLO  Key: XMCKL H E L L O message 7 (H) 4 (E) 11 (L) 11 (L) 14 (O) message + 23 (X) 12 (M) 2 (C) 10 (K) 11.
BASIC CRYPTOGRAPHIC CONCEPTS. Public Key Cryptography  Uses two keys for every simplex logical communication link.  Public key  Private key  The use.
Cryptography Wei Wu. Internet Threat Model Client Network Not trusted!!
Chapter 21 Public-Key Cryptography and Message Authentication.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Darci Miyashiro Math 480 April 29, 2013
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
1 Public-Key Cryptography and Message Authentication.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
Merkle-Hellman Knapsack Cryptosystem
Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department.
Cryptography 1 Crypto Cryptography 2 Crypto  Cryptology  The art and science of making and breaking “secret codes”  Cryptography  making “secret.
Public Key Cryptosystems RSA Diffie-Hellman Department of Computer Engineering Sharif University of Technology 3/8/2006.
Chapter 9 Public Key Cryptography and RSA. Private-Key Cryptography traditional private/secret/single key cryptography uses one key shared by both sender.
UNIVERSITY OF BIELSKO- BIALA AKADEMIA TECHNICZNO-HUMANISTYCZNA Faculty of Mechanical Engineering and Computer Science.
Computer Security Lecture 5 Ch.9 Public-Key Cryptography And RSA Prepared by Dr. Lamiaa Elshenawy.
Lecture 3 (Chapter 9) Public-Key Cryptography and RSA Prepared by Dr. Lamiaa M. Elshenawy 1.
ECE Prof. John A. Copeland fax Office: GCATT Bldg.
Introduction to Elliptic Curve Cryptography CSCI 5857: Encoding and Encryption.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
Elgamal Public Key Encryption CSCI 5857: Encoding and Encryption.
Lecture 9 Overview. RSA Invented by Cocks (GCHQ), independently, by Rivest, Shamir and Adleman (MIT) Two keys e and d used for Encryption and Decryption.
Public Key Cryptosystem In Symmetric or Private Key cryptosystems the encryption and decryption keys are either the same or can be easily found from each.
Digital Signatures.
Public Key Encryption.
Public Key Encryption and Digital Signatures
Cryptography and Security Technologies
Public-Key, Digital Signatures, Management, Security
Chapter 3 - Public-Key Cryptography & Authentication
Presentation transcript:

Public Key Encryption CS432 – Security in Computing Copyright © 2005, 2008 by Scott Orr and the Trustees of Indiana University

Section Overview Symmetric Key distribution issues Symmetric Key distribution issues Public Key encryption Public Key encryption Digital Signatures and Hashes Digital Signatures and Hashes Key Management Key Management

References Security in Computing, 3 rd Ed. Security in Computing, 3 rd Ed. Chapter 2 (pgs ) Chapter 2 (pgs ) Chapter 10 (pgs ; ) Chapter 10 (pgs ; ) Online Resources Online Resources Why Johnny Can't Encrypt: A Usability Evaluation of PGP 5.0, Alma Whitten, Carnegie Mellon University Why Johnny Can't Encrypt: A Usability Evaluation of PGP 5.0, Alma Whitten, Carnegie Mellon University Why Johnny Can't Encrypt: A Usability Evaluation of PGP 5.0 Why Johnny Can't Encrypt: A Usability Evaluation of PGP 5.0

Shared Secret Key Encryption Alice Bob Charlie Scott How does Alice distribute the key? How does Alice distribute the key? What happens if Scott leaves? What happens if Scott leaves?

Secret Key Pairs Alice Bob Charlie Scott # of Keys = n * (n – 1)/2 Where n is the # of users

Public-Key Encryption Encryption Decryption Recipient’s Public Key Recipient’s Private Key PlaintextPlaintextCiphertext

PKE Algorithm Components One or more Prime Numbers One or more Prime Numbers Large integer factoring Large integer factoring Modular arithmetic Modular arithmetic Example Algorithms Example Algorithms Merkle-Hellman Knapsacks Merkle-Hellman Knapsacks Rivest-Shivar-Adelman (RSA) Rivest-Shivar-Adelman (RSA) Diffie-Hellman Key Exchange Diffie-Hellman Key Exchange

Knapsack Concept Using each block only once, which blocks could be combined to completely fill this space without leaving any open squares inside or block parts outside the highlighted area?

Merkle-Hellman Knapsacks Use 1 knapsack for encoding a message Use 1 knapsack for encoding a message Use a 2 nd knapsack for decoding Use a 2 nd knapsack for decoding The knapsacks are mathematically related to each other The knapsacks are mathematically related to each other Modulus n Modulus n Multiplier w Multiplier w

Simple Knapsack Generation Create a simple (superincreasing) knapsack Create a simple (superincreasing) knapsack Select a (small) initial number Select a (small) initial number Each new number is greater than the sum of all previous numbers. Each new number is greater than the sum of all previous numbers. S = [ 1, 2, 4, 8 ] Pick n and w Pick n and w n is greater than the sum of S n is greater than the sum of S n and w have no common factors n and w have no common factors Easiest way: set n to a prime number Easiest way: set n to a prime number n > 15; set n = 17 / Pick w 15; set n = 17 / Pick w < n; w = 7

Hard Knapsack Generation Hard knapsack is a function of S, w, and n Hard knapsack is a function of S, w, and n h i = s i * w mod n h 1 = 1 * 7 mod 17 = 7 h 2 = 2 * 7 mod 17 = 14 h 3 = 4 * 7 mod 17 = 11 h 4 = 8 * 7 mod 17 = 5 H = [ 7, 14, 11, 5 ] H becomes the public key H becomes the public key S, n, and w together become the private key S, n, and w together become the private key

Encrypting a Message Message is broken down in binary blocks Message is broken down in binary blocks Block size = number of elements in H Block size = number of elements in H Calculate sum of PT * H for each block Calculate sum of PT * H for each block This becomes the encrypted message This becomes the encrypted message Sum 1 = = 23 Sum 2 = = 25 Sum 3 = = 18 Sum 4 = = 19 PT = / H = [ 7, 14, 11, 5 ] Message M = [ 23, 25, 18, 19 ]

Decrypting a Message Need to find inverse v of w: Need to find inverse v of w: w * v mod n = 1 w * v mod n = 1 Use Extended Euclidean Algorithm to find v Use Extended Euclidean Algorithm to find v 7 * v mod 17 = 1; v = 5 Calculate new sum totals: M i * v mod n Calculate new sum totals: M i * v mod n Sum 1 = 23 * 5 mod 17 = 13 Sum 2 = 25 * 5 mod 17 = 6 Sum 3 = 18 * 5 mod 17 = 5 Sum 4 = 19 * 5 mod 17 = 10 M = [ 23, 25, 18, 16 ] / Sum i = M i * 5 mod 17

Decrypting the Message (con’t.) To get the plaintext, we now use S To get the plaintext, we now use S S * PT i = Sum i Sum 1 = 13 = [ 1, 2, 4, 8 ] * PT 1 ; PT 1 = [1011] Sum 2 = 6 = [ 1, 2, 4, 8 ] * PT 2 ; PT 2 = [0110] Sum 3 = 5 = [ 1, 2, 4, 8 ] * PT 3 ; PT 3 = [1010] Sum 4 = 10 = [ 1, 2, 4, 8 ] * PT 4 ; PT 4 = [0101] PT =

RSA Public Key Encryption Developed by MIT professors Ron Rivest, Adi Shamir and Len Adleman (1977) Developed by MIT professors Ron Rivest, Adi Shamir and Len Adleman (1977) Message blocks treated as a large number less that some number n Message blocks treated as a large number less that some number n Block size 2 k bits  2 k < n < 2 k+1 Block size 2 k bits  2 k < n < 2 k+1 Relies on: Relies on: Large prime numbers Large prime numbers Large number factoring Large number factoring Modular arithmetic Modular arithmetic

RSA Key Generation Select 2 prime numbers, p and q Select 2 prime numbers, p and q Let n = p * q Let n = p * q Let  (n) = (p – 1)(q – 1) Let  (n) = (p – 1)(q – 1) Pick e that is relatively prime to  (n) Pick e that is relatively prime to  (n) Find d  d = e -1 mod  (n)  de = 1 mod  (n) Find d  d = e -1 mod  (n)  de = 1 mod  (n) Generated keys: Generated keys: Public: e & n Public: e & n Private: d & n Private: d & n

RSA Encryption & Decryption Encryption: Encryption: Break message into M sized blocks < n Break message into M sized blocks < n Cipher C = M e mod n Cipher C = M e mod n Decryption: Decryption: Message M = C d mod n Message M = C d mod n

RSA Example Key Generation: Key Generation: Let p = 5 and q = 11 Let p = 5 and q = 11 N = 5 * 11 = 55 N = 5 * 11 = 55  (n) = (5 – 1)(11 – 1) = 40  (n) = (5 – 1)(11 – 1) = 40 Let e = 3 Let e = 3 Find d  3d = 1 mod 40; d = 27 Find d  3d = 1 mod 40; d = 27 Encrypt M = 5  C = 5 3 mod 55 = 15 Encrypt M = 5  C = 5 3 mod 55 = 15 Decrypt C  M = mod 55 = 5 Decrypt C  M = mod 55 = 5

Digital Signatures HashEncryption HashDecryption Sender’s Private Key Sender’s Public Key PlaintextPlaintextSignedMessage

Hash Functions Accept messages of any size and generated a small, fixed size output Accept messages of any size and generated a small, fixed size output One way function One way function Easy and fast to calculate Easy and fast to calculate Collision Resistant Collision Resistant

XOR Example Break message into fixed length blocks Break message into fixed length blocks XOR first element of all blocks XOR first element of all blocks Repeat for all elements Repeat for all elements G o n o w E 5 E Source: Classical and Contemporary Cryptology by Richard J. Spillman Not very collision resistant!!!

MD5 Hash Developed by Ron Rivest Developed by Ron Rivest Generates a 128-bit hash Generates a 128-bit hash Initialization Initialization Pad message (1 followed by n 0s) such that the message size is 448 mod 512 Pad message (1 followed by n 0s) such that the message size is 448 mod 512 (message size) mod 2 64 appended to message as 64- bit number (message size) mod 2 64 appended to message as 64- bit number 4 32-bit registers used store intermediate and final results 4 32-bit registers used store intermediate and final results 512-bit message block processed in 4 rounds, each consisting of 16 stages 512-bit message block processed in 4 rounds, each consisting of 16 stages

Block i D C B A MD5 Rounds FT[1..16] D C B A GT[17..32]HT[33..48] IT[49..64] CV i CV i+1

G MD5 Stage D C B A Rot + Block i [k] T[j]DC B A

Birthday Paradox

El Gamal Keys Choose a large prime number, p, such that (p – 1) has a large prime factor, q Choose a large prime number, p, such that (p – 1) has a large prime factor, q Select 2 integers, x and a, such that x < p and a < p. Select 2 integers, x and a, such that x < p and a < p. Calculate y = a x mod p Calculate y = a x mod p Private Key: x Private Key: x Public Key: y, p, a Public Key: y, p, a

El Gamal Signatures Used to sign message, m Used to sign message, m Select an integer k such that: Select an integer k such that: 0 < k < p – 1 0 < k < p – 1 Not used previously Not used previously Relatively prime to (p – 1) Relatively prime to (p – 1) Message signature is r and s Message signature is r and s r = a k mod p r = a k mod p s = k -1 (m – xr) mod (p – 1) s = k -1 (m – xr) mod (p – 1)

El Gamal Signatures (Con’t) Checked: Checked: Calculate y r r s mod p Calculate y r r s mod p Should be same as a m mod p Should be same as a m mod p Digital Signature Standard (DSS) Digital Signature Standard (DSS) Based on El Gamal Based on El Gamal < p < < p < < q < < q < Uses a hash (SHA-1) instead of m Uses a hash (SHA-1) instead of m q, instead of (p – 1) is used to calculate r and s q, instead of (p – 1) is used to calculate r and s

Diffie-Hellman Key Exchange Bob and Alice together select a prime number, p, and a base, g Bob and Alice together select a prime number, p, and a base, g Alice: Alice: Selects secret number a Selects secret number a Sends Bob g a mod p Sends Bob g a mod p Bob: Bob: Selects secret number b Selects secret number b Sends Alice g b mod p Sends Alice g b mod p Shared secret: k Shared secret: k k = (g a mod p) b mod p = (g b mod p) a mod p k = (g a mod p) b mod p = (g b mod p) a mod p Used as key in symmetric cryptography algorithm Used as key in symmetric cryptography algorithm

“Pretty Good Privacy” Freely available PKE system Freely available PKE system Minimizes forging Minimizes forging Promotes privacy Promotes privacy Requires a Circle of Trust Requires a Circle of Trust Alternatives Alternatives MIME Object Security Services (MOSS) MIME Object Security Services (MOSS) Security Multiparts for MIME (S/MIME) Security Multiparts for MIME (S/MIME)

Public Key Distribution Sent via disk/ Sent via disk/ Downloaded from web page Downloaded from web page Public Key Server Public Key Server Fingerprints and key signing Fingerprints and key signing Public Key Infrastructure Public Key Infrastructure Certificate Authorities Certificate Authorities Registration Authorities Registration Authorities Certificate Distribution System Certificate Distribution System Key Escrow Key Escrow