Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.

Slides:



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

CS 483 – SD SECTION BY DR. DANIYAL ALGHAZZAWI (3) Information Security.
22C:19 Discrete Structures Integers and Modular Arithmetic
22C:19 Discrete Math Integers and Modular Arithmetic Fall 2010 Sukumar Ghosh.
 Stream ciphers o Encrypt chars/bits one at a time o Assume XOR w the key, need long key to be secure  Keystream generators (pseudo-random key) o Synchronous.
Josh Benaloh Brian LaMacchia Winter January 6, 2011Practical Aspects of Modern Cryptography Cryptography is... Protecting Privacy of Data Authentication.
ECOMMERCE TECHNOLOGY FALL 2003 COPYRIGHT © 2003 MICHAEL I. SHAMOS Cryptography.
Public Encryption: RSA
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
Fall 2010/Lecture 311 CS 426 (Fall 2010) Public Key Encryption and Digital Signatures.
Public Key Algorithms 4/17/2017 M. Chatterjee.
Public Key Cryptography RSA Diffie Hellman Key Management Based on slides by Dr. Lawrie Brown of the Australian Defence Force Academy, University College,
Public Key Model 8. Cryptography part 2.
Andreas Steffen, , 4-PublicKey.pptx 1 Internet Security 1 (IntSi1) Prof. Dr. Andreas Steffen Institute for Internet Technologies and Applications.
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 and Communications Network Security Department of Computer Science Virginia Commonwealth University.
RSA and its Mathematics Behind
Great Theoretical Ideas in Computer Science.
How cryptography is used to secure web services Josh Benaloh Cryptographer Microsoft Research.
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.
Modular Arithmetic with Applications to Cryptography Lecture 47 Section 10.4 Wed, Apr 13, 2005.
Public Key Cryptography. symmetric key crypto requires sender, receiver know shared secret key Q: how to agree on key in first place (particularly if.
Cryptography and Network Security Chapter 9 - Public-Key Cryptography
RSA and its Mathematics Behind July Topics  Modular Arithmetic  Greatest Common Divisor  Euler’s Identity  RSA algorithm  Security in RSA.
22C:19 Discrete Structures Integers and Modular Arithmetic Fall 2014 Sukumar Ghosh.
Lecture 6.1: Misc. Topics: Number Theory CS 250, Discrete Structures, Fall 2011 Nitesh Saxena.
Public Key Algorithms Lesson Introduction ●Modular arithmetic ●RSA ●Diffie-Hellman.
Josh Benaloh Senior Cryptographer Microsoft Research.
CS 4803 Fall 04 Public Key Algorithms. Modular Arithmetic n Public key algorithms are based on modular arithmetic. n Modular addition. n Modular multiplication.
Ch1 - Algorithms with numbers Basic arithmetic Basic arithmetic Addition Addition Multiplication Multiplication Division Division Modular arithmetic Modular.
Great Theoretical Ideas in Computer Science.
RSA Pubic Key Encryption CSCI 5857: Encoding and Encryption.
RSA Cryptosystem Great Theoretical Ideas In Computer Science S. Rudich V. Adamchik CS Spring 2006 Lecture 8Feb. 09, 2006Carnegie Mellon University.
Public Key Cryptography. Asymmetric encryption is a form of cryptosystem in which Encryption and decryption are performed using the different keys—one.
Lecture 5 Asymmetric Cryptography. Private-Key Cryptography Traditional private/secret/single key cryptography uses one key Shared by both sender and.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Revision. Cryptography depends on some properties of prime numbers. One of these is that it is rather easy to generate large prime numbers, but much harder.
Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia.
Overview Modern public-key cryptosystems: RSA
Practical Aspects of Modern Cryptography
Basics of Cryptography
Asymmetric-Key Cryptography
RSA Slides by Kent Seamons and Tim van der Horst
CS 2210:0001Discrete Structures Modular Arithmetic and Cryptography
Network Security Unit-III
Public Key Encryption and Digital Signatures
Number Theory (Chapter 7)
Practical Aspects of Modern Cryptography
Number Theory and Euclidean Algorithm
Asymmetric Cryptography
Practical Aspects of Modern Cryptography
Public Key Cryptography Diffie-Hellman, Discrete Log, RSA
PART VII Security.
Practical Aspects of Modern Cryptography
Practical Aspects of Modern Cryptography
Cryptography: Basics (2)
ADVANCED ENCRYPTION STANDARDADVANCED ENCRYPTION STANDARD
Practical Aspects of Modern Cryptography
NET 311 Information Security
Practical Aspects of Modern Cryptography
Practical Aspects of Modern Cryptography
Introduction to Cryptography
A General Introduction to Modern Cryptography
Presentation transcript:

Practical Aspects of Modern Cryptography Josh Benaloh & Brian LaMacchia

January 15, 2002Practical Aspects of Modern Cryptography Public-Key History 1976 New Directions in Cryptograhy Whit Diffie and Marty Hellman One-Way functions Diffie-Hellman Key Exchange 1978 RSA paper Ron Rivest, Adi Shamir, and Len Adleman RSA Encryption System RSA Digital Signature Mechanism

January 15, 2002Practical Aspects of Modern Cryptography The Fundamental Equation Z=Y X mod N

January 15, 2002Practical Aspects of Modern Cryptography Diffie-Hellman Z=Y X mod N When X is unknown, the problem is known as the discrete logarithm and is generally believed to be hard to solve.

January 15, 2002Practical Aspects of Modern Cryptography Diffie-Hellman Key Exchange Alice Randomly select a large integer a and send A = Y a mod N. Compute the key K = B a mod N. Bob Randomly select a large integer b and send B = Y b mod N. Compute the key K = A b mod N. B a = Y ba = Y ab = A b

January 15, 2002Practical Aspects of Modern Cryptography Diffie-Hellman Key Exchange What does Eve see? Y, Y a, Y b … but the exchanged key is Y ab. Belief: Given Y, Y a, Y b it is difficult to compute Y ab. Contrast with discrete logarithm assumption: Given Y, Y x it is difficult to compute x.

January 15, 2002Practical Aspects of Modern Cryptography One-Way Trap-Door Functions Z=Y X mod N Recall that this equation is solvable for Y if the factorization of N is known, but is believed to be hard otherwise.

January 15, 2002Practical Aspects of Modern Cryptography RSA Public-Key Cryptosystem Alice Select two large random primes P & Q. Publish the product N=PQ. Use knowledge of P & Q to compute Y. Anyone To send message Y to Alice, compute Z=Y X mod N. Send Z and X to Alice.

January 15, 2002Practical Aspects of Modern Cryptography Some RSA Details When N=PQ is the product of distinct primes, Y X mod N = Y whenever X mod (P-1)(Q-1) = 1 and 0  Y  N.

January 15, 2002Practical Aspects of Modern Cryptography Some RSA Details When N=PQ is the product of distinct primes, Y X mod N = Y whenever X mod (P-1)(Q-1) = 1 and 0  Y  N. Alice can easily select integers E and D such that ED mod (P-1)(Q-1) = 1.

January 15, 2002Practical Aspects of Modern Cryptography Some RSA Details Encryption: E(Y) = Y E mod N. Decryption: D(Y) = Y D mod N. D(E(Y)) = (Y E mod N) D mod N = Y ED mod N = Y

January 15, 2002Practical Aspects of Modern Cryptography RSA Signatures An additional property D(E(Y)) = Y ED mod N = Y E(D(Y)) = Y DE mod N = Y Only Alice (knowing the factorization of N) knows D. Hence only Alice can compute D(Y) = Y D mod N. This D(Y) serves as Alice’s signature on Y.

January 15, 2002Practical Aspects of Modern Cryptography Remaining RSA Basics Why is Y X mod PQ = Y whenever X mod (P-1)(Q-1) = 1, 0  Y  PQ, and P and Q are distinct primes? How can Alice can select integers E and D such that ED mod (P-1)(Q-1) = 1?

January 15, 2002Practical Aspects of Modern Cryptography Modular Arithmetic To compute (A+B) mod N, compute (A+B) and take the result mod N. To compute (A-B) mod N, compute (A-B) and take the result mod N. To compute (A×B) mod N, compute (A×B) and take the result mod N. To compute (A÷B) mod N, …

January 15, 2002Practical Aspects of Modern Cryptography Modular Division What is the value of (1÷2) mod 7? We need a solution to 2x mod 7 = 1. Try x = 4. What is the value of (7÷5) mod 11? We need a solution to 5x mod 11 = 7. Try x = 8.

January 15, 2002Practical Aspects of Modern Cryptography Modular Division Is modular division always well-defined? (1÷3) mod 6 = ? 3x mod 6 = 1 has no solution! Fact (A÷B) mod N always has a solution when gcd(B,N) = 1.

January 15, 2002Practical Aspects of Modern Cryptography Greatest Common Divisors gcd(A, B) = gcd(B, A - B) gcd(21,12) = gcd(12,9) = gcd(9,3) = gcd(6,3) = gcd(3,3) = gcd(0,3) = 3 gcd(A, B) = gcd(B, A mod B) gcd(21,12) = gcd(12,9) = gcd(9,3) = gcd(0,3) = 3

January 15, 2002Practical Aspects of Modern Cryptography Extended Euclidean Algorithm Given integers A and B, find integers X and Y such that AX + BY = gcd(A,B). When gcd(A,B) = 1, solve AX mod B = 1, by finding X and Y such that AX + BY = gcd(A,B) = 1. Compute (C÷A) mod B as C×(1÷A) mod B.

January 15, 2002Practical Aspects of Modern Cryptography Extended Euclidean Algorithm Given A,B > 0, set x 1 =1, x 2 =0, y 1 =0, y 2 =1, a 1 =A, b 1 =B, i=1. Repeat while b i >0: {i = i + 1; q = a i-1 div b i-1 ; b i = a i-1 -qb i-1 ; a i = b i-1 ; x i+1 =x i-1 -qx i ; y i+1 =y i-1 -qy i }. Ax i + By i = a i = gcd(A,B).

January 15, 2002Practical Aspects of Modern Cryptography Remaining RSA Basics Why is Y X mod PQ = Y whenever X mod (P-1)(Q-1) = 1, 0  Y  PQ, and P and Q are distinct primes? How can Alice can select integers E and D such that ED mod (P-1)(Q-1) = 1?

January 15, 2002Practical Aspects of Modern Cryptography Fermat’s Little Theorem If p is prime, then x p-1 mod p = 1 for all 0 < x < p. Equivalently … If p is prime, then x p mod p = x mod p for all integers x.

January 15, 2002Practical Aspects of Modern Cryptography The Binomial Theorem (x + y) p = x p + ( ) x p-1 y + … + ( ) xy p-1 + y p If p is prime, then ( ) mod p = 0 for 0 < i < p. Thus, (x + y) p mod p = (x p + y p ) mod p. p1p1 Proof of Fermat’s Little Theorem p p-1 pipi

January 15, 2002Practical Aspects of Modern Cryptography Proof of Fermat’s Little Theorem By induction on x… Basis If x = 0, then x p mod p = 0 = x mod p. If x = 1, then x p mod p = 1 = x mod p.

January 15, 2002Practical Aspects of Modern Cryptography Proof of Fermat’s Little Theorem Inductive Step Assume that x p mod p = x mod p. Then (x + 1) p mod p = (x p + 1 p ) mod p = (x + 1) mod p. Hence, x p mod p = x mod p for integers x ≥ 0. Also true for negative x, since (-x) p = (-1) p x p.

January 15, 2002Practical Aspects of Modern Cryptography Proof of RSA We have shown … Y P mod P = Y whenever 0 ≤ Y < P and P is prime! You will show … Y K(P-1)(Q-1)+1 mod PQ = Y when 0 ≤ Y < PQ P and Q are distinct primes and K ≥ 0.

January 15, 2002Practical Aspects of Modern Cryptography Authentication How can I use RSA to authenticate someone’s identity? If Alice’s public key E A, just pick a random message m and send E A (m). If m comes back, I must be talking to Alice.

January 15, 2002Practical Aspects of Modern Cryptography Authentication Should Alice be happy with this method of authentication? Bob sends Alice the authentication string y = “I owe Bob $1,000,000 - signed Alice.” Alice dutifully authenticates herself by decrypting (putting her signature on) y.

January 15, 2002Practical Aspects of Modern Cryptography Authentication What if Alice only returns authentication queries when the decryption has a certain format?

January 15, 2002Practical Aspects of Modern Cryptography RSA Cautions Is it reasonable to sign/decrypt something given to you by someone else? Note that RSA is multiplicative. Can this property be used/abused?

January 15, 2002Practical Aspects of Modern Cryptography RSA Cautions D(Y 1 ) D(Y 2 ) = D(Y 1 Y 2 ) Thus, if I’ve decrypted (or signed) Y 1 and Y 2, I’ve also decrypted (or signed) Y 1 Y 2.

January 15, 2002Practical Aspects of Modern Cryptography The Hastad Attack Given E 1 (x) = x 3 mod n 1 E 2 (x) = x 3 mod n 2 E 3 (x) = x 3 mod n 3 one can easily compute x.

January 15, 2002Practical Aspects of Modern Cryptography The Bleichenbacher Attack PKCS#1 Message Format: XX XX... XX 00 YY YY... YY random non-zero bytes message

January 15, 2002Practical Aspects of Modern Cryptography “Man-in-the-Middle” Attacks

January 15, 2002Practical Aspects of Modern Cryptography The Practical Side RSA can be used to encrypt any data. Public-key (asymmetric) cryptography is very inefficient when compared to traditional private-key (symmetric) cryptography.

January 15, 2002Practical Aspects of Modern Cryptography The Practical Side For efficiency, one generally uses RSA (or another public-key algorithm) to transmit a private (symmetric) key. The private session key is used to encrypt and authenticate any subsequent data. Digital signatures are only used to sign a digest of the message.

January 15, 2002Practical Aspects of Modern Cryptography Symmetric Ciphers Private-key (symmetric) ciphers are usually divided into two classes. Block ciphers Stream ciphers

January 15, 2002Practical Aspects of Modern Cryptography Symmetric Ciphers Private-key (symmetric) ciphers are usually divided into two classes. Block ciphers Stream ciphers

January 15, 2002Practical Aspects of Modern Cryptography Block Ciphers Block Cipher Plaintext DataCiphertext Key

January 15, 2002Practical Aspects of Modern Cryptography Block Ciphers Block Cipher Plaintext DataCiphertext Key Currently usually 8 bytes. Soon bytes.

January 15, 2002Practical Aspects of Modern Cryptography Block Cipher Modes Electronic Code Book (ECB) Encryption: Block Cipher Block Cipher Block Cipher Block Cipher Plaintext Ciphertext

January 15, 2002Practical Aspects of Modern Cryptography Block Cipher Modes Electronic Code Book (ECB) Decryption: Inverse Cipher Inverse Cipher Inverse Cipher Inverse Cipher Plaintext Ciphertext

January 15, 2002Practical Aspects of Modern Cryptography Block Cipher Modes Electronic Code Book (ECB) Encryption: Block Cipher Block Cipher Block Cipher Block Cipher Plaintext Ciphertext

January 15, 2002Practical Aspects of Modern Cryptography Block Cipher Modes Cipher Block Chaining (CBC) Encryption: Block Cipher Block Cipher Block Cipher Block Cipher Plaintext Ciphertext IV

January 15, 2002Practical Aspects of Modern Cryptography Block Cipher Modes Cipher Block Chaining (CBC) Decryption: Inverse Cipher Inverse Cipher Inverse Cipher Inverse Cipher Plaintext Ciphertext IV

January 15, 2002Practical Aspects of Modern Cryptography Block Cipher Modes Cipher Block Chaining (CBC) Encryption: Block Cipher Block Cipher Block Cipher Block Cipher Plaintext Ciphertext IV

January 15, 2002Practical Aspects of Modern Cryptography How to Build a Block Cipher Block Cipher Plaintext Ciphertext Key

January 15, 2002Practical Aspects of Modern Cryptography Feistel Ciphers Ugly

January 15, 2002Practical Aspects of Modern Cryptography Feistel Ciphers Ugly

January 15, 2002Practical Aspects of Modern Cryptography Feistel Ciphers Ugly

January 15, 2002Practical Aspects of Modern Cryptography Ugly Feistel Ciphers

January 15, 2002Practical Aspects of Modern Cryptography Feistel Ciphers Ugly

January 15, 2002Practical Aspects of Modern Cryptography Feistel Ciphers Typically, most Feistel ciphers are iterated for about 16 rounds. Different “sub-keys” are used for each round. Even a weak round function can yield a strong Feistel cipher if iterated sufficiently.

January 15, 2002Practical Aspects of Modern Cryptography Data Encryption Standard (DES) Block Cipher 64-bit Plaintext 64-bit Ciphertext 56-bit Key

January 15, 2002Practical Aspects of Modern Cryptography Data Encryption Standard (DES) 64-bit Plaintext 64-bit Ciphertext 56-bit Key 16 Feistel Rounds

January 15, 2002Practical Aspects of Modern Cryptography Data Encryption Standard (DES) 64-bit Plaintext 64-bit Ciphertext 56-bit Key 16 Feistel Rounds

January 15, 2002Practical Aspects of Modern Cryptography DES Round Ugly

January 15, 2002Practical Aspects of Modern Cryptography Simplified DES Round Function Sub-key 4-bit substitutions 32-bit permutation Ugly 32 bits

January 15, 2002Practical Aspects of Modern Cryptography Actual DES Round Function Sub-key 6/4-bit substitutions 32-bit permutation Ugly 32 bits 48 bits

January 15, 2002Practical Aspects of Modern Cryptography Symmetric Ciphers Private-key (symmetric) ciphers are usually divided into two classes. Block ciphers Stream ciphers

January 15, 2002Practical Aspects of Modern Cryptography Stream Ciphers Use the key as a seed to a pseudo-random number-generator. Take the stream of output bits from the PRNG and XOR it with the plaintext to form the ciphertext.

January 15, 2002Practical Aspects of Modern Cryptography Stream Cipher Encryption Plaintext: PRNG(seed): Ciphertext:

January 15, 2002Practical Aspects of Modern Cryptography Stream Cipher Decryption Plaintext: PRNG(seed): Ciphertext:

January 15, 2002Practical Aspects of Modern Cryptography A PRNG: Alleged RC4 Initialization S[0..255] = 0,1,…,255 K[0..255] = Key,Key,Key,… for i = 0 to 255 j = (j + S[i] + K[i]) mod 256 swap S[i] and S[j]

January 15, 2002Practical Aspects of Modern Cryptography A PRNG: Alleged RC4 Iteration i = (i + 1) mod 256 j = (j + S[i]) mod 256 swap S[i] and S[j] t = (S[i] + S[j]) mod 256 Output S[t]

January 15, 2002Practical Aspects of Modern Cryptography Stream Cipher Integrity It is easy for an adversary (even one who can’t decrypt the ciphertext) to alter the plaintext in a known way. Bob to Bob’s Bank: Please transfer $0,000, to the account of my good friend Alice.

January 15, 2002Practical Aspects of Modern Cryptography Stream Cipher Integrity It is easy for an adversary (even one who can’t decrypt the ciphertext) to alter the plaintext in a known way. Bob to Bob’s Bank: Please transfer $1,000, to the account of my good friend Alice.

January 15, 2002Practical Aspects of Modern Cryptography Stream Cipher Integrity It is easy for an adversary (even one who can’t decrypt the ciphertext) to alter the plaintext in a known way. Bob to Bob’s Bank: Please transfer $1,000, to the account of my good friend Alice. This can be protected against by the careful addition of appropriate redundancy.

January 15, 2002Practical Aspects of Modern Cryptography One-Way Hash Functions The idea of a check sum is great, but it is designed to prevent accidental changes in a message. For cryptographic integrity, we need an integrity check that is resilient against a smart and determined adversary.

January 15, 2002Practical Aspects of Modern Cryptography One-Way Hash Functions Generally, a one-way hash function is a function H : {0,1}*  {0,1} k (typically k is 128 or 160) such that given an input value x, one cannot find a value x  x such H(x) = H(x ).

January 15, 2002Practical Aspects of Modern Cryptography One-Way Hash Functions There are many measures for one-way hashes. Non-invertability: given y, it’s difficult to find any x such that H(x) = y. Collision-intractability: one cannot find a pair of values x  x such that H(x) = H(x ).

January 15, 2002Practical Aspects of Modern Cryptography One-Way Hash Functions When using a stream cipher, a hash of the message can be appended to ensure integrity. [Message Authentication Code] When forming a digital signature, the signature need only be applied to a hash of the message. [Message Digest]

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA-1 Compression Function 160-bit Output 512-bit Input (IV)

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds No Change

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds Rotate 30 bits

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds No Change

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds No Change

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds ?

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA-1 What’s in the final 32-bit transform? Take the rightmost word. Add in the leftmost word rotated 5 bits. Add in a round-dependent function f of the middle three words.

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds f

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA-1 Depending on the round, the “non-linear” function f is one of the following. f(X,Y,Z) = (X  Y)  ((  X)  Z) f(X,Y,Z) = (X  Y)  (X  Z)  (Y  Z) f(X,Y,Z) = X  Y  Z

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA-1 What’s in the final 32-bit transform? Take the rightmost word. Add in the leftmost word rotated 5 bits. Add in a round-dependent function f of the middle three words.

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA-1 What’s in the final 32-bit transform? Take the rightmost word. Add in the leftmost word rotated 5 bits. Add in a round-dependent function f of the middle three words. Add in a round-dependent constant.

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA-1 What’s in the final 32-bit transform? Take the rightmost word. Add in the leftmost word rotated 5 bits. Add in a round-dependent function f of the middle three words. Add in a round-dependent constant. Add in a portion of the 512-bit message.

January 15, 2002Practical Aspects of Modern Cryptography A Cryptographic Hash: SHA bit512-bit One of 80 rounds

January 15, 2002Practical Aspects of Modern Cryptography Cryptographic Tools One-Way Trapdoor Functions Public-Key Encryption Schemes One-Way Functions One-Way Hash Functions Pseudo-Random Number-Generators Secret-Key Encryption Schemes Digital Signature Schemes