lecture 9: email security via pgp cs 436/636/736 spring 2012 nitesh saxena

23
Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Upload: arnold-hunt

Post on 24-Dec-2015

223 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Lecture 9: Email Security via PGP

CS 436/636/736 Spring 2012

Nitesh Saxena

Page 2: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Course Admin

• HW3 Posted– Due at 11am Apr 12 (next Thursday)

Lecture 9 - Email Security via PGP

Page 3: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Email Security

• Email is one of the most widely used and regarded network services

• By default, email communication is NOT “secure”– may be inspected either in transit, or by suitably

privileged users on destination system– may be impersonated/spoofed

Lecture 9 - Email Security via PGP

Page 4: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Email Security Enhancements

• Confidentiality– protection from disclosure

• Authentication– of sender of message

• Message integrity– protection from modification

• Non-repudiation of origin– protection from denial by sender

Lecture 9 - Email Security via PGP

Page 5: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Pretty Good Privacy (PGP)

• Open source, freely available software package for secure e-mail

• De facto standard for secure email• Developed by Phil Zimmermann• Selected best available crypto algorithms to use• Runs on a variety of platforms like Unix, PC,

Macintosh and other systems • Originally free (now also have commercial

versions available)

Lecture 9 - Email Security via PGP

Page 6: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Operation – Authentication

Just use digital signatures:1. Sender creates message2. Generates a digital signature for the message3. Use SHA-1 to generate 160-bit hash of message 4. Signed hash with RSA (or DSA) using sender's private key,

and is attached to message5. Receiver uses RSA (or DSA) with sender's public key to

decrypt and recover hash code6. Receiver verifies received message using hash of it and

compares with decrypted hash code

Lecture 9 - Email Security via PGP

Page 7: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Operation – Confidentiality

1. Sender generates a message 2. Generates a128-bit random number as session key3. Encrypts the message using CAST-128 / IDEA / 3DES

in CBC mode with session key4. Session key encrypted using RSA with recipient's

public key and attached to the msg1. Can also use El Gamal

5. Receiver uses RSA with private key to decrypt and recover session key

6. Session key is used to decrypt message

Lecture 9 - Email Security via PGP

Page 8: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Operation – Confidentiality & Authentication

• Can use both services on the same message– create signature & attach it to the message– encrypt both message & signature– attach RSA (or El Gamal) encrypted session key

This sequence is preferred because --one can store the plaintext message/file and its signature--no need to decrypt the message/file again and again

Lecture 9 - Email Security via PGP

Page 9: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Operation – Compression

• PGP compresses messages to save space for e-mail transmission and storage

• By default, PGP compresses message after signing but before encrypting– so can store uncompressed message & signature for later

verification– Encryption after compression strengthens security

(because compression has less redundancy)

• uses ZIP compression algorithm

Lecture 9 - Email Security via PGP

Page 10: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Operation – Email Compatibility

• When using PGP will have binary data (8-bit octets) to send (encrypted message, etc)

• However, email was designed only for text• Hence PGP must encode raw binary data into

printable ASCII characters• uses radix-64 algorithm– maps 3 bytes to 4 printable chars– also appends a CRC

• PGP also segments messages if too big (maximum length 50,000 octets)

Lecture 9 - Email Security via PGP

Page 11: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Operation – Summary

Lecture 9 - Email Security via PGP

Page 12: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Session Keys

• Need a session key for each message– of varying sizes: 56-bit DES, 128-bit CAST or IDEA,

168-bit Triple-DES

• Uses random inputs taken from – actual keys hit – keystroke timing of a user– mouse movement

Lecture 9 - Email Security via PGP

Page 13: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Public & Private Keys

• Since many public/private keys may be in use, need to identify which is actually used to encrypt session key in a message– Could send full public-key with every message– But, this is inefficient

• Rather use a key identifier based on key– is least significant 64-bits of the key– will very likely be unique

• also use key ID in signatures

Lecture 9 - Email Security via PGP

Page 14: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Key Rings

• each PGP user has a pair of keyrings:– public-key ring contains all the public-keys of

other PGP users known to this user, indexed by key ID

– private-key ring contains the public/private key pair(s) for this user, indexed by key ID & encrypted keyed from a hashed passphrase

• security of private keys thus depends on the pass-phrase security

Lecture 9 - Email Security via PGP

Page 15: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Message Format

Lecture 9 - Email Security via PGP

Page 16: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Message Generation

Lecture 9 - Email Security via PGP

Page 17: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Message Reception

Lecture 9 - Email Security via PGP

Page 18: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Key Distribution

• Public keys for encrypting session keys / verifying signatures.

• Private keys for decrypting session keys / creating signatures.

• Where do these keys come from and on what basis can they be trusted?

Lecture 9 - Email Security via PGP

Page 19: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Key Distribution

• PGP adopts a trust model called the web of trust.• No centralized authority • Individuals sign one another’s public keys, these

“certificates” are stored along with keys in key rings.• PGP computes a trust level for each public key in key

ring.• Users interpret trust level for themselves.

Lecture 9 - Email Security via PGP

Page 20: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP Key Distribution Issues

• Original intention was that all e-mail users would contribute to web of trust.

• Reality is that this web is sparsely populated.• How should security-unaware users assign and

interpret trust levels?• Later versions of PGP support X.509 certs.

Lecture 9 - Email Security via PGP

Page 21: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

PGP in Practice

• PGP plugins available – Standalone Email clients– Browser (e.g., FireGPG)

Lecture 9 - Email Security via PGP

Page 22: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

Summary

• have considered:– secure email– PGP

Lecture 9 - Email Security via PGP

Page 23: Lecture 9: Email Security via PGP CS 436/636/736 Spring 2012 Nitesh Saxena

References

• Chapter 18 of Stallings

Lecture 9 - Email Security via PGP