Electronic mail security
Chap 8 1
Outline
Pretty good privacy
S/MIME
Recommended web sites
Chap 8 2
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
Chap 8 3
Pretty Good Privacy (PGP)
• widely used de facto secure email
• developed by Phil Zimmermann
• selected best available crypto algs to
use
• integrated into a single program
• available on Unix, PC, Macintosh and
Amiga systems
• originally free, now have commercial
versions available also
Chap 8 4
Why Is PGP Popular?
It is availiable free on a variety of platforms.
Based on well known algorithms.
Wide range of applicability
Not developed or controlled by governmental or standards
organizations
Chap 8 5
Operational Description
Consist of five services:
Authentication
Confidentiality
Compression
E-mail compatibility
Segmentation
Chap 8 6
Chap 8 7
PGP Operation –
Authentication
1. sender creates a message
2. SHA-1 used to generate 160-bit hash code of
message
3. hash code is encrypted with RSA using the
sender's private key, and result is attached
to message
4. receiver uses RSA or DSS with sender's
public key to decrypt and recover hash code
5. receiver generates new hash code for
message and compares with decrypted hash
code, if match, message is accepted as
authentic
Chap 8 8
PGP Operation –
Confidentiality
1. sender generates message and random 128-
bit number to be used as session key for this
message only
2. message is encrypted, using CAST-128 /
IDEA/3DES with session key
3. session key is encrypted using RSA with
recipient's public key, then attached to
message
4. receiver uses RSA with its private key to
decrypt and recover session key
5. session key is used to decrypt message
Chap 8 9
PGP Operation – Confidentiality
& Authentication
• uses both services on same message
– create signature & attach to message
– encrypt both message & signature
– attach RSA encrypted session key
Chap 8 10
PGP Operation – Compression
• by default PGP compresses message
after signing but before encrypting
– so can store uncompressed message &
signature for later verification
– & because compression is non deterministic
• uses ZIP compression algorithm
Chap 8 11
PGP Operation – Email
Compatibility
• when using PGP will have binary data 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
Chap 8 12
E-mail Compatibility
The scheme used is radix-64 conversion (see appendix 5B).
The use of radix-64 expands the message by 33%.
24* 4/3=32
Chap 8 13
Segmentation and Reassembly
Often restricted to a maximum message length of 50,000
octets.
Longer messages must be broken up into segments.
PGP automatically subdivides a message that is to large.
The receiver strip of all e-mail headers and reassemble the
block.
Chap 8 14
Summary of PGP Services
Function Algorithm Used
Digital Signature DSS/SHA or
RSA/SHA
Message CAST or IDEA or
Encryption three-key triple DES
with Diffie-Hellman
or RSA
Compression ZIP
E-mail Radix-64 conversion
Compatibility
Segmentation -Chap 8 15
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
• generated using ANSI X12.17 mode
• uses random inputs taken from previous
uses and from keystroke timing of user
Chap 8 16
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
Chap 8 17
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
Chap 8 18
PGP Key Management
• rather than relying on certificate
authorities
• in PGP every user is own CA
– can sign keys for users they know directly
• forms a “web of trust”
– trust keys have signed
– can trust keys others have signed if have a
chain of signatures to them
• key ring includes trust indicators
• users can also revoke their keys
Chap 8 19
Chap 8 20
Format of PGP Message
Chap 8 21
Chap 8 22
Chap 8 23
Chap 8 24
The Use of Trust
Associated with each public key in the Key ring
One Key legitimacy field: (the extent the PGP will trust
this public key; computed by PGP)
One or more Signature trust field: (lists of signatures on
this certificates; associated with each signature is assigned
a signature bit;
; sig trust bit 1 + sig trust bit 2 + .. key legitmacy bit)
Owner trust field : (the degree to which this public key is
trusted to sign other certificates )
Chap 8 25
Chap 8 26
Chap 8 27
Revoking Public Keys
The owner issue a key revocation certificate.
Normal signature certificate with a revote indicator.
Corresponding private key is used to sign the certificate.
Chap 8 28
S/MIME (Secure/Multipurpose
Internet Mail Extensions)
• security enhancement to MIME email
– original Internet RFC822 email was text
only
– MIME provided support for varying content
types and multi-part messages
– with encoding of binary data to textual
form
– S/MIME added security enhancements
• have S/MIME support in various modern
mail agents: MS Outlook, Netscape etc
Chap 8 29
RFC 822
From: "Microsoft Outlook Express Team"
To: =?big5?B?t3MgT3V0bG9vayBFeHByZXNzIKjPpc6qzA==?=
Subject:
=?big5?B?xXeq76jPpc4gT3V0bG9vayBFeHByZXNzIDU=?=
Date: Mon, 29 Sep 2003 13:02:38 +0800
Hello This is a test
Chap 8 30
Simple Mail Transfer Protocol (SMTP, RFC
822)
SMTP Limitations - Can not transmit, or has a problem with:
executable files, or other binary files (jpeg image)
“national language” characters (non-ASCII)
messages over a certain size
SMTP gateway that translates ASCII to EBCDIC do not use a
consistent set of mapping
SMTP gateway to X.400 cannot handle nontextual data in X.400
Truncating lines longer than a certain length (72 to 254 characters)
Chap 8 31
Header fields in MIME
MIME-Version: Must be “1.0” -> RFC 2045, RFC 2046
Content-Type: More types being added by developers
(application/word)
Content-Transfer-Encoding: How message has been encoded
(radix-64)
Content-ID: Unique identifying character string. (Optional)
Content Description: Needed when content is not readable text
(e.g.,mpeg) (Optional)
Chap 8 32
Chap 8 33
Chap 8 34
MIME Example (1)
From: "Microsoft Outlook Express Team"
To: =?big5?B?t3MgT3V0bG9vayBFeHByZXNzIKjPpc6qzA==?=
Subject: =?big5?B?xXeq76jPpc4gT3V0bG9vayBFeHByZXNzIDU=?=
Date: Mon, 29 Sep 2003 13:02:38 +0800
MIME-Version: 1.0
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200
font{font-family:"MingLiu";font-size:9pt;color:#000000}
A:hover.defaultA{color:#999900}
A:hover.bodyTopLine{color:#0000FF}
A:hover {color:#0033FF}
:
Chap 8 35
MIME Example (2)
From: "=?big5?B?uOqwVL7Hqvmiug==?="
To:
Subject:
=?big5?B?pU7C4Lx4qESudrjqOiCw6qXfquqnwKzsp96kar7HuOqkdah0pM6tuL73qHS42w=
Date: Mon, 1 Mar 2004 11:49:12 +0800
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0010_01C3FF83.3B89A160"
X-Priority: 3
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Return-Path: ccchiu@mail.ncku.edu.tw
X-OriginalArrivalTime: 01 Mar 2004 03:58:00.0296 (UTC) FILETIME=[63733E80:01C3FF41]
This is a multi-part message in MIME format.
------=_NextPart_000_0010_01C3FF83.3B89A160
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0011_01C3FF83.3B8B2800":
Chap 8 36
MIME Example (2)
------=_NextPart_001_0011_01C3FF83.3B8B2800
Content-Type: text/plain;
charset="big5"
Content-Transfer-Encoding: quoted-printable
=B3o=ACO=B8=EA=B0T=BE=C7=AA=F9=AA=BA=A5N=C2=E0=B0T=AE=A7=AAA=B0=C8
=A1A=AD=
Y=B1z=A4=A3=C4@=A6=AC=A8=EC =":
=B0=EA=A5=DF=AA=EA=A7=C0=AC=EC=A7=DE=A4j=BE=C7=B8=EA=A4u=A8t=A4=CE=
AD=B8=BE=
=F7=A8t=B8=DB=BCx=B1=D0=AEv=A1A=B8=D4=A8=A3=AA=FE=A5=F3=A1C
------=_NextPart_001_0011_01C3FF83.3B8B2800
Content-Type: text/html;
charset="big5"
Content-Transfer-Encoding: quoted-printable
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
Chap 8 37
S/MIME Functions
• enveloped data
– encrypted content and associated keys
• signed data
– (message + signed digest) base64 encoding
• clear-signed data
– cleartext message + encoded signed digest
• signed & enveloped data
– nesting of signed & encrypted entities
Chap 8 38
S/MIME Cryptographic
Algorithms
• hash functions: SHA-1 & MD5
• digital signatures: DSS & RSA
• session key encryption: ElGamal & RSA
• message encryption: Triple-DES,
RC2/40 and others
• have a procedure to decide which
algorithms to use
Chap 8 39
S/MIME Certificate
Processing
• S/MIME uses X.509 v3 certificates
• managed using a hybrid of a strict
X.509 CA hierarchy & PGP’s web of
trust
• each client has a list of trusted CA’s
certs
• and own public/private key pairs & certs
• certificates must be signed by trusted
CA’s
Chap 8 40
Certificate Authorities
• have several well-known CA’s
• Verisign one of most widely used
• Verisign issues several types of Digital IDs
• with increasing levels of checks & hence trust
Class Identity Checks Usage
1 name/email check web browsing/email
2+ enroll/addr check email, subs, s/w validate
3+ ID documents e-banking/service
access
Chap 8 41
Chap 8 42
User Agent Role
S/MIME uses Public-Key Certificates - X.509 version 3 signed by
Certification Authority
Functions:
Key Generation - Diffie-Hellman, DSS, and RSA key-pairs.
Registration - Public keys must be registered with X.509 CA.
Certificate Storage - Local (as in browser application) for different
services.
Signed and Enveloped Data - Various orderings for encrypting and
signing.
Chap 8 43
User Agent Role
Example: Verisign (www.verisign.com)
Class-1: Buyer’s email address confirmed by emailing vital info.
Class-2: Postal address is confirmed as well, and data checked
against directories.
Class-3: Buyer must appear in person, or send notarized
documents.
Chap 8 44
Chap 8 45