Unit V - Email security-PGP, MIME
Unit V - Email security-PGP, MIME
CSE - AVCCE 1
Email Security
CSE - AVCCE 2
Introduction
CSE - AVCCE 3
PGP
CSE - AVCCE 4
PGP – Operational description
• The actual operation of PGP consists of five services:
– authentication,
– confidentiality,
– compression,
– e-mail compatibility
– segmentation and Reassembly(Table 12.1.)
Authenticaiton
– The sender creates a message
– SHA-1 is used to generate 160-bit hash code
– Hash code is encrypted with RSA using senders private key
– Receiver uses RSA to decrypt the hash code
– Receiver generates a new hash code and compares with the
decrypted one
CSE - AVCCE 5
CSE - AVCCE 6
Confidentiality
CSE - AVCCE 7
Confidentiality and Authentication
CSE - AVCCE 8
Compression
CSE - AVCCE 9
E-mail compatibility
• Encrypted parts of the message form a stream of 8-bit octets.
• PGP converts the 8 bit binary blocks into printable ASCII characters.
This is called radix-64 conversion
• Each groupof 3 octets(8x3) is divided into four 6-bit blocks(6x4)
• Each 6-bit is replaced with ASCII character.
• 8-bit 00100011 01011100 10010001
• 6-bit 001000 110101 110010 010001
• Decimal 8 53 50 17
• Char. I 1 y R
CSE - AVCCE 62 + 10
Radix-64 blindly converts the input stream into ASCII even if the input is
an ASCII character. So the message will be unreadable to a normal person
which provides some confidentiality.
CSE - AVCCE 11
CSE - AVCCE 12
CSE - AVCCE 13
Introduction
CSE - AVCCE 14
RFC 822
• defines a format for text messages to be sent using e-mail
• The msg. consists of header and body(text). Both are separated by
blank line.
• structure of RFC 822 messages:
- header lines (e.g., from: …, to: …, cc: …)
– blank line
– body (the text to be sent)
• example
Blablabla
CSE - AVCCE 15
Problems with RFC 822 and SMTP
CSE - AVCCE 16
MIME
• MIME is an extension to the RFC 822 addressing many limitations of
the use of SMTP.
• defines new message header fields
• defines a number of content formats (standardizing representation of
multimedia contents)
• defines transfer encodings that protects the content from alteration by
the mail system
• The MIME content types are listed in table 12.3.
CSE - AVCCE 17
MIME - Header fields
There are 5 header fields
• MIME-Version
• Content-Type
– describes the data contained in the body
– receiving agent can pick an appropriate method to represent the
content
• Content-Transfer-Encoding
– indicates the type of the transformation that has been used to
represent the body of the message (e.g) radix 64
• Content-ID
– Unique identification of MIME entities
• Content-Description
– description of the object in the body of the message
– useful when content is not readable (e.g., audio data)
CSE - AVCCE 18
18
In general, multi part has more parts. Each part has a parameter called
boundary. Each boundary starts on a new line indicated by 2 hyphens(--)
The last boundary has structure --boundary --
CSE - AVCCE 19
MIME – Transfer encodings
Transfer encodings for msg. body is necessary to provide reliable delivery
over large environments.
• 7bit
– short lines of ASCII characters
• 8bit
– short lines of non-ASCII characters
• binary
– non-ASCII characters
– lines are not necessarily short
• quoted-printable
– non-ASCII characters are converted into hexa numbers (e.g., =EF)
• base64 (radix 64)
– 3 8-bit blocks into 4 6-bit blocks
• x-token
– non-standard encoding
CSE - AVCCE 20
20
MIME – Example
MIME-Version: 1.0
From: Nathaniel Borenstein <[email protected]>
To: Ned Freed <[email protected]>
Date: Fri, 07 Oct 1994 16:15:05 -0700 (PDT)
Subject: A multipart example
Content-Type: multipart/mixed; boundary=unique-boundary-1
This is the preamble area of a multipart message. Mail readers that understand multipart format
should ignore this preamble. If you are reading this text, you might want to consider changing to a mail reader
that understands how to properly display multipart messages.
--unique-boundary-1
Content-type: text/plain; charset=US-ASCII
… Some text …
--unique-boundary-1
Content-Type: multipart/parallel; boundary=unique-boundary-2
--unique-boundary-2
Content-Type: audio/basic
Content-Transfer-Encoding: base64
... base64-encoded 8000 Hz single-channel mu-law-format audio data goes here ...
--unique-boundary-2
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
--unique-boundary-2--
CSE - AVCCE 21
21
MIME – Example cont’d
--unique-boundary-1
Content-type: text/enriched
--unique-boundary-1
Content-Type: message/rfc822
--unique-boundary-1--
CSE - AVCCE 22
22
S/MIME Functionality
• The general functionality of S/MIME is very similar to PGP both
offering the ability to sign and/or encrypt messages.
S/MIME Functions
CSE - AVCCE 25
CRYPTOGRAPHIC ALGORITHMS
• message digest
– must: SHA-1
– should (receiver): MD5 (backward compatibility)
• digital signature
– must: DSS
– should: RSA
• asymmetric-key encryption
– must: ElGamal
– should: RSA
• symmetric-key encryption
– sender:
• should: 3DES, RC2/40
– receiver:
• must: 3DES
• should: RC2/40
CSE - AVCCE 26
CSE - AVCCE 27
The sending agent must consider 2 issues:
• Whether receiver is capable of decrypting his algorithm
• If receiver can accept only weak algorithm, sender must decide
whether it can allowed.
For this Sender and receiver must have preference list of encryption alg.
used.
The rules to be followed by sending agent are
• If the sender has preference list of receiver, it should choose the top
alg. in the list.
• If there is no list , sender should use the same alg. which was used in
last transaction
• If sender has no knowledge about receiver , but it is willing to take
risk, Sender Should use 3DES .
• If sender has no knowledge about receiver , but it is not willing to take
risk, Sender Should use RC2/40 .
CSE - AVCCE 28
Securing a MIME entity
• Canonical form:
Format that is standardized for all types of system. It is
appropriate to content type
29 CSE - AVCCE 29
S/MIME Content Types
CSE - AVCCE 30
• Enveloped data
– The steps for preparing this entity are
Sender End
1) Generate the pseudo random session key.
2) Encrypt the session key with recipients public RSA key.
3) Prepare a RecipientInfo block containing recepient’s certificate
ID, Encryption algorithm ID and the encrypted session key.
4) Encrypt the message content with the session key.
5) This information is then encoded into radix-64
Receiver End
1) First cut-off radix64 encoding
2) Receiver private key is used to recover the session key.
3) Session key is used to recover the message.
CSE - AVCCE 31
PKCS7 “enveloped data”
Version
Encrypted Key
Encrypted Content
32 CSE - AVCCE 32
Enveloped data – Example
Content-Type: application/pkcs7-mime; smime-type=enveloped-data; name=smime.p7m
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7m
rfvbnj756tbBghyHhHUujhJhjH77n8HHGT9HG4VQpfyF467GhIGfHfYT6
7n8HHGghyHhHUujhJh4VQpfyF467GhIGfHfYGTrfvbnjT6jH7756tbB9H
f8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
0GhIGfHfQbnj756YT64V
33 CSE - AVCCE 33
• Signed data
Sender End
1) Select a message digest algorithm.
2) Compute the MD of msg. Content.
3) Encrypt the message digest with senders private key
4) Prepare SignerInfo block containing
• signer’s public key certificate
• message digest algorithm ID
• Encryption algorithm ID and
• encrypted message digest.
5) This information is then encoded into radix-64
Receiver End
1) Cut-off radix64
2) Sender’s public key is used to decrypt the MD
3) Receiver calculates the MD seperately
4) Both are compared to verify the signature
CSE - AVCCE 34
PKCS7 “signed data”
Content type
Content
Version
Digest Algorithm
Authenticated Attributes
35 CSE - AVCCE 35
• Clear signed data
Sender End
It belongs to multipart/signed type. The msg has 2 parts
– First part contains clear message.
– Second part contains encrypted message digest. And this is
encoded using radix64
Receiver End
CSE - AVCCE 36
Clear-signed data – Example
Content-Type: multipart/signed; protocol="application/pkcs7-signature";
micalg=sha1; boundary=boundary42
--boundary42
Content-Type: text/plain
--boundary42
Content-Type: application/pkcs7-signature; name=smime.p7s
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=smime.p7s
ghyHhHUujhJhjH77n8HHGTrfvbnj756tbB9HG4VQpfyF467GhIGfHfYT6
4VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756tbB9HGTrfvbnj
n8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfHfYT6ghyHhHUujpfyF4
7GhIGfHfYT64VQbnj756
--boundary42--
37 CSE - AVCCE 37
S/MIME Functionality
• Registration request
– A user typically applies to a CA for a public-key certificate.
Application/PKS10 entity is used to transfer a certification request
– It contains a certification RequestInfo block- name of the certificate user,
public key, encryption algorithm ID.
• Certificates-only message
– This is sent as response to registration request.
– Either a certificate (or) CRL can come as response
– Content type is application/pkcs7mime(degenerate)
CSE - AVCCE 38
S/MIME – Certificate Processing
• S/MIME users must configure each client with a list of trusted keys
and certificate revocation lists.
– the responsibility for maintaining certificates needed to verify incoming
messages and encrypt outgoing ones is local.
– however, the cerificates are signed by certification authorities.
User’s role
• An S/MIME user has several key-management functions to perform
• Key generation: the user MUST be able to generate DSS and D-H key
pairs and SHOULD be able to generate RSA key pairs. Key size must
be >512 bits
• Registration: a user’s public key must be registered with a CA in order
to receive an X.509 certificate.
• Certificate storage and retrieval: a list of certificates can be
maintained by the user locally
CSE - AVCCE 39