Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

41
Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa Spring 2006 David Evans Class 4: Modern Cryptograph y http://www.cs.virginia.edu/jillcryp

description

Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa Spring 2006 David Evans. Class 4: Modern Cryptography. http://www.cs.virginia.edu/jillcrypto. Menu. Some loose ends on WWII Maurice Burnett Modern Cryptography Modern symmetric ciphers Public-key cryptosystems. - PowerPoint PPT Presentation

Transcript of Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

Page 1: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

Cryptography in World War IIJefferson Institute for Lifelong Learning at UVa

Spring 2006 David Evans

Class 4:Modern

Cryptography

http://www.cs.virginia.edu/jillcrypto

Page 2: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

2JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Menu

• Some loose ends on WWII• Maurice Burnett

• Modern Cryptography– Modern symmetric ciphers– Public-key cryptosystems

Page 3: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

3JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

British Cipher Machine• Design based on

commercial Enigma• 5 rotor wheels (instead

of 3 in Enigma)• Multiple rings per rotor• Last 2 rotor wheels

didn’t rotate• British attempted to

break it (without success)

Typex Machine

Page 4: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

4JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

German Code-Breaking Efforts

• About 6,000 people (compare to 12,000 working at Bletchley Park)

• Decentralized: each military branch had their own, didn’t share what they learned

• Effective against manual codes: broke about 50% of manually coded messages

• Didn’t attempt to break rotor-based ciphers – so confident Enigma was unbreakable, didn’t try to Typex and similar machines

Page 5: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

5JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Page 6: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

6JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

From http://www.codesandciphers.org.uk/lorenz/fish.htm

Lorenz Cipher

Page 7: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

7JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Modern Symmetric Ciphers A billion billion is a large number, but

it's not that large a number.Whitfield Diffie

• Same idea but:– Use digital logic instead of

mechanical rotors– Larger keys (random bits, not rotor

alignments)•Lorenz 512 < 109

•Modern 128 bits > 1037

– Encrypt blocks of letters at a time

Page 8: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

8JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Modern Ciphers

• AES (Rijndael) successor to DES selected 2001

• 128-bit keys, encrypt 128-bit blocks• Brute force attack (around 1030 times

harder than Lorenz)– Try 1 Trillion keys per second– Would take 10790283070806000000 years to

try all keys! – If that’s not enough, can use 256-bit key

• No known techniques that do better than brute force search

Page 9: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

9JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Login: alyssaPassword: fido

Terminal

Trusted Subsystem

Eve

Login Process

login sends <“alyssa”, “fido”>

Page 10: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

10JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Sending Passwords

Encrypt

User Server

The InternetThe Internet

Page 11: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

11JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Encrypt DecryptPlaintext

Ciphertext

Plaintext

User ServerC = EncryptK (P)P = DecryptK (C)

K K

The InternetThe Internet

Page 12: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

12JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Key Agreement Demo

(Animated version atend of slides.)

Page 13: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

13JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Asymmetric Cryptosystems

• Need a hard problem (like symmetric cryptosystems)

• With a trap door: if you know a secret, the hard problem becomes easy

Page 14: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

14JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

One-Way Functions• Easy to compute, hard to invert• Trap-door one way function:

– D (E (M)) = M– E and D are easy to compute.– Revealing E doesn’t reveal an easy way

to compute D.– Hence, anyone who knows E can encrypt,

but only someone who knows D can decrypt

Page 15: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

15JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

RSA [Rivest, Shamir, Adelman 78]One-way function:

multiplication is easy, factoring is hardTrap-door: number theory (Euler and Fermat)

Page 16: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

16JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Security of RSA• n is public, but not p and q where n =

pq

• How much work is factoring n?

n ~200 digits – would take quintillions of years

Number Field Sieve (fastest known factoring algorithm) is:

O(e1.9223((ln (n))1/3 (ln (ln (n)))2/3)

Page 17: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

17JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Asymmetric Cryptosystems

• Encryption and Decryption are done with different keys

• Keep one of the keys secret, reveal the other

EKRA (EKUA (M)) = MAlice’s Public Key: KUA

Alice’s Private Key: KRA

Only KRA can decrypta message encryptedusing KUA.

Page 18: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

18JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Public-Key Applications: Privacy

• Alice encrypts message to Bob using Bob’s Public Key

• Only Bob knows Bob’s Private Key

only Bob can decrypt message

Encrypt DecryptPlaintextCiphertext

Plaintext

Alice Bob

Bob’s Public Key Bob’s Private Key

Page 19: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

19JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Signatures

• Bob knows it was from Alice, since only Alice knows Alice’s Private Key

• Non-repudiation: Alice can’t deny signing message (except by claiming her key was stolen!)

• Integrity: Bob can’t change message (doesn’t know Alice’s Private Key)

Encrypt DecryptPlaintext

SignedMessage

Plaintext

AliceBob

Alice’s Private Key Alice’s Public Key

Page 20: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

20JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Encrypt DecryptPlaintext

Ciphertext

Plaintext

User Server

KUS KRS

The InternetThe Internet

Public Key Private Key

How does User know the public key to use?

Page 21: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

21JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Key Management

Page 22: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

22JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Approach 1: Meet Secretly

• User and Server Operator meet secretly and swap public keys– If you can do that, might as well agree

on a secret (symmetric key) instead– Doesn’t work for Internet transactions

Page 23: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

23JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Approach 2: Public Announcement

• Publish public keys in a public forum– Append to email messages– Post on web site– New York Time classifieds

• Easy for rogue to pretend to be someone else– Forge email, alter web site, lie to New

York Times

Page 24: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

24JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Approach 3: Public Directory• Trusted authority maintains directory

mapping names to public keys• Entities register public keys with

authority in some secure way• Authority publishes directory

– Print using watermarked paper, special fonts, etc.

– Allow secure electronic access• Depends on secure distribution of directory’s

key

Page 25: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

25JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Approach 4: Certificates

VeriSign

User Server

KUS

CS = EKRVeriSign[“Server”, KUS]

CS

Request

$$$$

EKUVeriSign (CS) = [“Server”, KUS] Knows KRS

Page 26: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

26JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

SSL (Secure Sockets Layer)

Browser ServerHello

KRCA[Server Identity, KUS]

Check Certificate

using KUCA Pick random K

KUS[K]Find K using KRS

Secure channel using K

Note: This is slightly simplified from the actual SSL protocol. This versionis vulnerable to a person-in-the-middle attack!

Page 27: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

27JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Data encrypted using secret key exchanged using some public keyassociated with some certificate.

Page 28: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

28JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Page 29: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

29JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Page 30: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

30JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Page 31: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

31JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

SSL RecapBrowser Server

Hello

KRCA[Server Identity, KUS]

Check Certificate

using KUCA Pick random K

KUS[K]Find K using KRS

Secure channel using K

Note: This is slightly simplified from the actual SSL protocol. This versionis vulnerable to a person-in-the-middle attack!

Page 32: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

32JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Questions?

Page 33: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

33JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Animated version of Asymmetric Cryptography

Demo

Page 34: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

34JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Hi!

Page 35: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

35JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice Hi!

Alice’s Padlock

Alice’s Padlock Key

Page 36: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

36JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Alice’s Padlock Key

Shady Sammy’s

Slimy Shipping Service

Page 37: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

37JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Hi!

Bob

Bob’s Padlock

Bob’s Padlock KeyAlice’s Padlock Key

Page 38: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

38JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Hi!

Bob

Bob’s Padlock KeyAlice’s Padlock Key

Page 39: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

39JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Hi!

Bob

Bob’s Padlock KeyAlice’s Padlock Key

Page 40: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

40JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Hi!

Bob

Bob’s Padlock Key

Page 41: Cryptography in World War II Jefferson Institute for Lifelong Learning at UVa

41JILL WWII Crypto Spring 2006 - Class 4: Modern Cryptography

Padlocked Boxes

Alice

Hi!

Bob

Bob’s Padlock Key

Hi!