+ All Categories
Home > Documents > Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997....

Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997....

Date post: 14-Aug-2020
Category:
Upload: others
View: 2 times
Download: 0 times
Share this document with a friend
30
Dawn Song Crypto: Symmetric-Key Cryptography Computer Security Course. Dawn Song Slides credit: Dan Boneh, David Wagner, Doug Tygar
Transcript
Page 1: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Crypto: Symmetric-Key Cryptography

Computer Security Course. Dawn Song

Slides credit: Dan Boneh, David Wagner, Doug Tygar

Page 2: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Overview• Cryptography: secure communication

over insecure communication channels• Three goals

– Confidentiality– Integrity– Authenticity

Page 3: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Brief History of Crypto• 2,000 years ago

– Caesar Cypher: shifting each letter forward by a fixed amount– Encode and decode by hand

• During World War I/II– Mechanical era: a mechanical device for encrypting

messages

• After World War II– Modern cryptography: rely on mathematics and electronic

computers

Page 4: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Modern Cryptography• Symmetric-key cryptography

– The same secret key is used by both endpoints of a communication

• Public-key cryptography– Two endpoints use different keys

Page 5: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Attacks to Cryptography• Ciphertext only

– Adversary has E(m1), E(m2), …

• Known plaintext– Adversary has E(m1)&m1, E(m2)&m2, …

• Chosen plaintext– Adversary picks m1, m2, … (potentially adaptively)– Adversary sees E(m1), E(m2), …

• Chosen ciphertext– Adversary picks E(m1), E(m2), … (potentially adaptively)– Adversary sees m1, m2, …

Page 6: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

One-time Pad• K: random n-bit key• P: n-bit message (plaintext)• C: n-bit ciphertext• Encryption: C = P xor K• Decryption: P = C xor K• A key can only be used once• Impractical!

Page 7: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Block Cipher• Encrypt/Decrypt messages in fixed

size blocks using the same secret key– k-bit secret key– n-bit plaintext/ciphertext

E, D Ciphertext Block

n bits

Plaintext Blockn bits

Key k Bits

Page 8: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Feistel cipher

L1 R1

EncryptionStart with (L0, R0)Li+1=Ri

Ri+1=Li xor F(Ri,Ki)

DecryptionStart with (Rn+1, Ln+1)Ri=Li+1

Li=Ri+1 xor F(Li+1,Ki)

Li Ri

Rn Ln

Rn+1-i Ln+1-i

Page 9: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

DES - Data Encryption Standard (1977)

• Feistel cipher• Works on 64 bit block with 56 bit

keys• Developed by IBM (Lucifer) improved

by NSA• Brute force attack feasible in 1997

Page 10: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

AES – Advanced Encryption Standard (1997)

• Rijndael cipher– Joan Daemen & Vincent Rijmen

• Block size 128 bits• Key can be 128, 192, or 256 bits

Page 11: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Abstract Block Ciphers: PRPs and PRFs

PRF: F: K X Y such that: exists “efficient” algorithm to eval. F(k,x)

PRP: E: K X X such that:1. Exists “efficient” algorithm to eval. E(k,x)

2. The func E( k, ) is one-to-one

3. Exists “efficient” algorithm for inverse D(k,x)

A block cipher is a PRP

Page 12: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Secure PRF and Secure PRP• A PRF F: K X Y is secure if F(k, ) is indistinguishable from a random func. f: X Y

• A PRP E: K X X is secure if E(k, ) is indisting. from a random perm. : X X

k K

f Funs[X,Y]x X

f(x) or F(k,x)???

Page 13: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Modes of Operation• Block ciphers encrypt fixed size blocks

– eg. DES encrypts 64-bit blocks with 56-bit key

• Need to en/decrypt arbitrary amounts of data• NIST SP 800-38A defines 5 modes• Block and stream modes• Cover a wide variety of applications• Can be used with any block cipher

Page 14: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Electronic Code Book (ECB)

• Message is broken into independent blocks which are encrypted

• Each block is a value which is substituted, like a codebook

• Each block is encoded independently of the other blocks

• Uses: secure transmission of single values

•  

Page 15: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &
Page 16: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &
Page 17: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Advantages and Limitations of ECB

•Message repetitions may show in ciphertext –If aligned with message block –Particularly with data such graphics –Or with messages that change very little

•Encrypted message blocks independent •Not recommended

Page 18: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 19: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 20: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 21: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Cipher Block Chaining (CBC)

Page 22: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 23: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 24: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Advantages and Limitations of CBC

•Ciphertext block depends on all blocks before it•Change to a block affects all following blocks•Need Initialization Vector (IV)

–Random numbers–Must be known to sender & receiver

Page 25: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 26: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Page 27: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Stream Modes of Operation

•Block modes encrypt entire block

•May need to operate on smaller units–Real time data

•Convert block cipher into stream cipher–Counter (CTR) mode

•Use block cipher as PRNG (Pseudo Random Number Generator)

Page 28: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Counter (CTR)

•Encrypts counter value

•Need a different key & counter value for every plaintext block

–Oi=EK(IV+i)

–Ci=Pi xor Oi

•Uses: high-speed network encryption

Page 29: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Counter (CTR)

Counter mode with a random IV: (parallel encryption)

m[0] m[1] …

Ek(IV) Ek(IV+1) …

m[L]

Ek(IV+L)

c[0] c[1] … c[L]

IV

IV

ciphertext

Page 30: Crypto: Symmetric-Key Cryptographycs161/sp15/slides/... · •Brute force attack feasible in 1997. AES – Advanced Encryption Standard (1997) •Rijndael cipher –Joan Daemen &

Dawn Song

Advantages and Limitations of CTR

•Efficiency–Can do parallel encryptions in h/w or s/w

–Can preprocess in advance of need

–Good for bursty high speed links

•Random access to encrypted data blocks

•Must ensure never reuse key/counter values, otherwise could break


Recommended