Cryptography & Network
Security
William Stallings
Chapter 19
Ch 14 Electronic Mail Security
3
Outline
•Mail Architecture
•Mail Security
▫PGP
▫S/MIME
4
Email Architecture
5
Email Security
• email is one of the most widely used and
regarded network services
• currently message contents are not
secure
▫ may be inspected either in transit
▫ or by suitably privileged users on
destination system
6
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
7
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
• on Unix, PC, Macintosh and other
systems
• originally free, now also have
commercial versions available
• provides confidentiality and
authentication
8
Table 19.1 Summary of PGP Services
9
PGP Operation – Authentication
1. sender creates message
2. use SHA-1 to generate 160-bit hash of message
3. signed hash with RSA using sender's private key,
and is attached to message
4. receiver uses RSA with sender's public key to
decrypt and recover hash code
5. receiver verifies received message using hash of it
and compares with decrypted hash code
10
PGP Operation – Confidentiality
1. sender generates message and 128-bit random
number as session key for it
2. encrypt message using CAST-128 / IDEA / 3DES in
CBC mode with session key
3. session key encrypted using RSA with recipient's
public key, & attached to msg
4. receiver uses RSA with private key to decrypt and
recover session key
5. session key is used to decrypt message
11
PGP Operation – Confidentiality &
Authentication
• can use both services on same message
▫ create signature & attach to message
▫ encrypt both message & signature
▫ attach RSA/ElGamal encrypted session key
12
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
13
Radix 64
Encode Non-ASCII character to ASCII
character :
1. The binary input is split into blocks of 24
bits (3 bytes).
2. Each 24 block is then split into four sets
each of 6-bits.
3. Each 6-bit set will then have a value
between 0 and 26-1 (=63).
4. This value is encoded into a printable
character.
14
Radix 64
15
PGP Operation – Summary
16
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
17
PGP Message Generation
18
PGP Message Reception
19
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
20
Outline
•Mail Architecture
•Mail Security
▫PGP
▫S/MIME
21
Secure/Multipurpose Internet
Mail Extension (S/MIME)
• A security enhancement to the MIME
Internet e-mail format standard based
on technology from RSA Data Security
• Defined in:
▫ RFCs 3370, 3850, 3851, 3852
22
Multipurpose Internet Mail Extensions
(MIME)
MIME specification includes the following
elements:
• An extension to the RFC
5322 framework that is Five new
Transfer
intended to address some encodings are message
of the problems and defined that header fields
enable the are defined,
limitations of the use of which may be
conversion of
Simple Mail Transfer any content included in an
Protocol (SMTP) format into a RFC 5322
form that is header; these
▫ Is intended to resolve fields provide
protected from
these problems in a alteration by information
manner that is the mail about the body
system of the message
compatible with
existing RFC 5322 A number of
implementations content formats are
defined, thus
▫ The specification is standardizing
provided in RFCs 2045 representations that
through 2049 support multimedia
electronic mail
23
The Five Header Fields Defined in MIME
MIME-Version
• Must have the parameter value 1.0
• This field indicates that the message conforms to RFCs 2045 and 2046
Content-Type
• Describes the data contained in the body with sufficient detail that the
receiving user agent can pick an appropriate agent or mechanism to
represent the data to the user or otherwise deal with the data in an
appropriate manner
Content-Transfer-Encoding
• Indicates the type of transformation that has been used to represent the
body of the message in a way that is acceptable for mail transport
Content-ID
• Used to identify MIME entities uniquely in multiple contexts
Content-Description
• A text description of the object with the body; this is useful when the
object is not readable
24
Table
19.2
MIME
Content
Types
25
Example …
Content-Type: message/partial;
id=“forouzan@[Link]”
;
number=1;
total=3;
…………………
……………….
26
Example …
Content-Type: message/external-body;
name=“[Link]”;
site=“[Link]”;
access-type=“ftp”;
…………………
……………….
27
Table 19.3
MIME Transfer Encodings
28
Table 19.3
MIME Transfer Encodings
Quoted-printable
29
Multipurpose Internet Mail Extensions
(MIME)
30
31
Securing a MIME Entity
• S/MIME secures a MIME entity with a
signature, encryption, or both
• The MIME entity is prepared according to
the normal rules for MIME message
preparation
▫ The MIME entity plus some security-related
data, such as algorithm identifiers and
certificates, are processed by S/MIME to
produce what is known as a PKCS object
▫ A PKCS object is then treated as message
content and wrapped in MIME
• In all cases the message to be sent is
converted to canonical form
32
S/MIME Functionality
Signed data
• A digital signature is formed by
Enveloped data
taking the message digest of the
• Consists of encrypted content of any content to be signed and then
type and encrypted content encrypting that with the private key
encryption keys for one or more of the signer
recipients • The content plus signature are then
encoded using base64 encoding
• A signed data message can only be
viewed by a recipient with S/MIME
capability
S/MIME
Clear-signed data Signed and enveloped data
• Only the digital signature is encoded • Signed-only and encrypted-only
using base64 entities may be nested, so that
• As a result recipients without encrypted data may be signed and
S/MIME capability can view the signed data or clear-signed data may
message content, although they be encrypted
cannot verify the signature
33
S/MIME Cryptographic
Algorithms
• digital signatures: DSS & RSA
• hash functions: SHA-1 & MD5
• session key encryption: ElGamal & RSA
• message encryption: AES, Triple-DES,
RC2/40 and others
• MAC: HMAC with SHA-1
• have process to decide which algs to use
34
Table 19.6
S/MIME Content Types
35
EnvelopedData
• The steps for preparing an envelopedData
MIME are:
Generate a pseudorandom session key for a
particular symmetric encryption algorithm
For each recipient, encrypt the session key with
the recipient’s public RSA key
For each recipient, prepare a block known as
RecipientInfo that contains an identifier of the
recipient’s public-key certificate, an identifier
of the algorithm used to encrypt the session
key, and the encrypted session key
Encrypt the message content with the session
key
36
EnvelopedData
37
EnvelopedData
38
SignedData
• The steps for preparing a
signedData MIME are:
39
SignedData
40
SignedData
41
Clear Signing
• Achieved using the multipart content type
with a signed subtype
• This signing process does not involve
transforming the message to be signed
• Recipients with MIME capability but not
S/MIME capability are able to read
the incoming message
42
Clear Signing
43
S/MIME Functions
• enveloped data
▫ encrypted content and associated keys
• signed data
▫ encoded message + signed digest
• clear-signed data
▫ cleartext message + encoded signed digest
• signed & enveloped data
▫ nesting of signed & encrypted entities
44
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
45
Certificate Authorities
• have several well-known CA’s
• Verisign one of most widely used
• Verisign issues several types of Digital IDs
• increasing levels of checks & hence trust
Class Identity Checks Usage
1 name/email check web
browsing/email
2 + enroll/addr check email, s/w
validate
3 + ID documents e-banking/service
access
46
Summary
• have considered:
▫ secure email
▫ PGP
▫ S/MIME
Questions?