Unit 4 Material
Unit 4 Material
The 64-bit cipher feedback (CFB) mode is used. In PGP, each conventional key is used
only once. That is, a new key is generated as a random 128-bit number for each message. Thus
although this is referred to as a session key, it is in reality a onetime key. To protect the key, it
is encrypted with the receiver‟s public key.
The sequence for confidentiality is as follows:
The sender generates a message and a random 128-bit number to be used as a
session key for this message only.
The message is encrypted using CAST-128 with the session key.
The session key is encrypted with RSA, using the receiver‟s public key and is
prepended to the message.
The receiver uses RSA with its private key to decrypt and recover the session
key.
The session key is used to decrypt the message.
Confidentiality and authentication
Here both services may be used for the same message. First, a signature is generated
for the plaintext message and prepended to the message. Then the plaintext plus the signature
is encrypted using CAST-128 and the session key is encrypted using RSA.
3. Compression
As a default, PGP compresses the message after applying the signature but before
encryption. This has the benefit of saving space for both e-mail transmission and for file storage.
The signature is generated before compression for two reasons:
It is preferable to sign an uncompressed message so that one can store only the
uncompressed message together with the signature for future verification. If one
signed a compressed document, then it would be necessary either to store a
compressed version of the message for later verification or to recompress the
message when verification is required.
Even if one were willing to generate dynamically a recompressed message from
verification, PGP‟s compression algorithm presents a difficulty. The algorithm is not
deterministic; various implementations of the algorithm achieve different tradeoffs in
running speed versus compression ratio and as a result, produce different
compression forms.
Message encryption is applied after compression to strengthen cryptographic security. Because
the compressed message has less redundancy than the original plaintext, cryptanalysis is more
difficult. The compression algorithm used is ZIP
Fig 5.1: PGP Cryptographic Functions
4. E-mail compatibility
Many electronic mail systems only permit the use of blocks consisting of ASCII texts. To
accommodate this restriction, PGP provides the service of converting the raw 8-bit binary
stream to a stream of printable ASCII characters. The scheme used for this purpose is radix-64
conversion. Each group of three octets of binary data is mapped into four ASCII characters.
The solution adopted by PGP is to assign a key ID to each public key that is, with very
high probability, unique within a user ID. The key ID associated with each public key consists of
its least significant 64 bits. i.e., the key ID of public key KUa is (KUa mod 264).
A message consists of three components.
Message component – includes actual data to be transmitted, as well as the
filename and a timestamp that specifies the time of creation
Session key component – includes session key and the identifier of the recipient
public key.
Signature component – includes the following
Timestamp – time at which the signature was made.
Message digest – hash code.
Two octets of message digest – to enable the recipient to determine if the
correct public key was used to decrypt the message.
Key ID of sender’s public key – identifies the public key
Notation:
EkUb= encryption with user B‟s Public key
EKRa= encryption with user A‟s private key
EKs = encryption with session key
ZIP = Zip compression function
R64 = Radix- 64 conversion function
Fig 5.2: Transmission and Reception of PGP message
PGP provides a pair of data structures at each node, one to store the public/private key
pair owned by that node and one to store the public keys of the other users known at that node.
These data structures are referred to as private key ring and public key ring.
The general structures of the private and public key rings are shown below:
PGP retrieves the sender‟s private key from the private key ring using user ID as an
index. If user ID was not provided, the first private key from the ring is retrieved.
PGP prompts the user for the passphrase (password) to recover the unencrypted private
key.
The signature component of the message is constructed.
PGP retrieves the receiver‟s private key from the private key ring, using the key ID field
in the session key component of the message as an index.
PGP prompts the user for the passphrase (password) to recover the unencrypted private
key.
PGP then recovers the session key and decrypts the message.
PGP retrieves the sender‟s public key from the public key ring, using the key ID field in
the signature key component of the message as an index.
PGP recovers the transmitted message digest.
PGP computes the message digest for the received message and compares it to the
transmitted message digest to authenticate.
Fig 5.6: PGP message reception
S/MIME
MIME is an extension to the RFC 822 framework that is intended to address some of the
problems and limitations of the use of SMTP (Simple Mail Transfer Protocol) or some other mail
transfer protocol and RFC 822 for electronic mail.
Following are the limitations of SMTP/822 scheme:
1. SMTP cannot transmit executable files or other binary objects.
2. SMTP cannot transmit text data that includes national language characters because
these are represented by 8-bit codes with values of 128 decimal or higher, and SMTP is limited
to 7-bit ASCII.
3. SMTP servers may reject mail message over a certain size.
4. SMTP gateways that translate between ASCII and the character code EBCDIC do not
use a consistent set of mappings, resulting in translation problems.
5. SMTP gateways to X.400 electronic mail networks cannot handle non textual data
included in X.400 messages.
6. Some SMTP implementations do not adhere completely to the SMTP standards
defined in RFC 821. Common problems include:
MIME is intended to resolve these problems in a manner that is compatible with existing
RFC 822 implementations. The specification is provided in RFCs 2045 through 2049.
OVERVIEW
The MIME specification includes the following elements:
1. Five new message header fields are defined, which may be included in an RFC 822
header. These fields provide information about the body of the message.
2. A number of content formats are defined, thus standardizing representations that
support multimedia electronic mail.
3. Transfer encodings are defined that enable the conversion of any content format into a
form that is protected from alteration by the mail system.
In this subsection, we introduce the five message header fields. The next two subsections deal
with content formats and transfer encodings.
The five header fields defined in MIME are as follows:
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.
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 (e.g., audio data).
For the text type of body, no special software is required to get the full meaning of the
text, aside from support of the indicated character set. The primary subtype is plain text, which
is simply a string of ASCII characters or ISO 8859 characters. The enriched subtype allows
greater formatting flexibility.
The multipart type indicates that the body contains multiple, independent parts. The
Content-Type header field includes a parameter, called boundary, that defines the delimiter
between body parts.
The multipart/digest subtype is used when each of the body parts is interpreted as an
RFC 822 message with headers. This subtype enables the construction of a message whose
parts are individual messages. For example, the moderator of a group might collect e-mail
messages from participants, bundle these messages, and send them out in one encapsulating
MIME message.
The message type provides a number of important capabilities in MIME. The
message/rfc822 subtype indicates that the body is an entire message, including header and
body. Despite the name of this subtype, the encapsulated message may be not only a simple
RFC 822 message, but also any MIME message.
The message/partial subtype enables fragmentation of a large message into a number
of parts, which must be reassembled at the destination. For this subtype, three parameters are
specified in the Content-Type: Message/Partial field: an id common to all fragments of the same
message, a sequence number unique to each fragment, and the total number of fragments.
The message/external-body subtype indicates that the actual data to be conveyed in
this message are not contained in the body. Instead, the body contains the information needed
to access the data.
MIME Transfer Encodings
The quoted-printable transfer encoding is useful when the data consists largely of octets
that correspond to printable ASCII characters. In essence, it represents non safe characters by
the hexadecimal representation of their code and introduces reversible (soft) line breaks to limit
message lines to 76 characters.
The base64 transfer encoding, also known as radix-64 encoding, is a common one for
encoding arbitrary binary data in such a way as to be invulnerable to the processing by mail
transport programs.
Canonical Form
An important concept in MIME and S/MIME is that of canonical form. Canonical form is a
format, appropriate to the content type that is standardized for use between systems. This is in
contrast to native form, which is a format that may be peculiar to a particular system.
S/MIME Functionality
In terms of general functionality, S/MIME is very similar to PGP. Both offer the ability to
sign and/or encrypt messages.
Functions:
Cryptographic Algorithms
Table 1 summarizes the cryptographic algorithms used in S/MIME. S/MIME uses the
following terminology, taken from RFC 2119 to specify the requirement level:
S/MIME makes use of a number of new MIME content types, which are shown in Table
2. All of the new application types use the designation PKCS. This refers to a set of public-key
cryptography specifications issued by RSA Laboratories and made available for the S/MIME
effort.
Table 2: S/MIMEContent Types
Type Subtype SMIME Description
Parameter
Multipart Signed A clear-signed message in two
parts: one is the message and the
other is the signature.
PKCS 7- Signed Data A signed S/MIME entity.
MIME
PKCS 7- Enveloped An encrypted S/MIME entity.
MIME Data
PKCS 7- degenerate An entity containing only public-
Application MIME signed Data key certificates.
PKCS 7- Compressed A compressed S/MIME entity
MIME Data
PKCS 7- signed Data The content type of the signature
SIGNATURE subpart of a multipart/signed
message.
1) Enveloped Data
2) Signed Data
The steps for preparing a signed Data MIME entity are as follows:
3) Clear Signing
Clear signing is achieved using the multipart content type with a signed subtype.
As was mentioned, this signing process does not involve transforming the message to
be signed, so that the message is sent "in the clear."
Thus, recipients with MIME capability but not S/MIME capability are able to read the
incoming message.
A multipart/signed message has two parts.
The first part can be any MIME type but must be prepared so that it will not be
altered during transfer from source to destination. This means that if the first part is not 7bit,
then it needs to be encoded using base64 or quoted-printable.
This second part has a MIME content type of application and a subtype of PKCS7-
signature The protocol parameter indicates that this is a two-part clear-signed entity. The
receiver can verify the signature by taking the message digest of the first part and comparing
this to the message digest recovered from the signature in the second part.
Registration Request
The user will apply to a certification authority for a public-key certificate. The S/MIME
entity is used to transfer a certification request.
The certification request includes certification Request Info block, followed by an
identifier of the public-key encryption algorithm, followed by the signature of the
certification Request Info block, made using the sender's private key.
The certification Request Info block includes a name of the certificate subject (the
entity whose public key is to be certified) and a bit-string representation of the user's
public key.
Certificates-Only Message
A message containing only certificates or a certificate revocation list (CRL) can be sent
in response to a registration request. The message is an application/PKCS7-MIME type/subtype
with an SMIME-type parameter of degenerate. The steps involved are the same as those for
creating a signed Data message, except that there is no message content and the signer Info
field is empty.
There are several companies that provide certification authority (CA) services. There are
a number of Internet-based CAs, including VeriSign, GTE, and the U.S. Postal Service.
VeriSign provides a CA service that is intended to be compatible with S/MIME and a
variety of other applications. VeriSign issues X.509 certificates with the product name VeriSign
Digital ID.
The information contained in a Digital ID depends on the type of Digital ID and its
use. At a minimum, each Digital ID contains
Owner's public key
Owner's name or alias
Expiration date of the Digital ID
Serial number of the Digital ID
Name of the certification authority that issued the Digital ID
Digital signature of the certification authority that issued the Digital ID
Address
E-mail address
Basic registration information (country, zip code, age, and gender)
VeriSign provides three levels, or classes, of security for public-key certificates. A user requests
a certificate online at VeriSign's Web site or other participating Web sites. Class 1 and Class 2
requests are processed on line, and in most cases take only a few seconds to approve. Briefly,
the following procedures are used:
For Class 1 Digital IDs, VeriSign confirms the user's e-mail address by sending a PIN
and Digital ID pick-up information to the e-mail address provided in the application.
For Class 2 Digital IDs, VeriSign verifies the information in the application through an
automated comparison with a consumer database in addition to performing all of the
checking associated with a Class 1 Digital ID.
o Finally, confirmation is sent to the specified postal address alerting the user that
a Digital ID has been issued in his or her name.
For Class 3 Digital IDs, VeriSign requires a higher level of identity assurance. An
individual must prove his or her identity by providing notarized credentials or applying in
person.
Enhanced Security Services
Signed receipts:
A signed receipt may be requested in a Signed Data object. Returning a signed receipt
provides proof of delivery to the originator of a message and allows the originator to
demonstrate to a third party that the recipient received the message.
Security labels:
The user can be relieved of this work by employing the services of an S/MIME Mail List
Agent (MLA). An MLA can take a single incoming message, perform the recipient-specific
encryption for each recipient, and forward the message.
The originator of a message need only send the message to the MLA, with encryption
performed using the MLA's public key.
NON REPUDIATION
Non-repudiation is the assurance that someone cannot deny something. Typically, non-
repudiation refers to the ability to ensure that a party to a contract or a communication cannot
deny the authenticity of their signature on a document or the sending of a message that they
originated.
To repudiate means to deny. On the Internet, a digital signature is used not only to
ensure that a message or document has been electronically signed by the person that purported
to sign the document, but also, since a digital signature can only be created by one person, to
ensure that a person cannot later deny that they furnished the signature.
Since no security technology is absolutely fool-proof, some experts warn that a digital
signature alone may not always guarantee non-repudiation. It is suggested that multiple
approaches be used, such as capturing unique biometric information and other data about the
sender or signer that collectively would be difficult to repudiate.
OVERVIEW OF IPSEC
Applications of IPSec
IPSec provides the capability to secure communications across a LAN, across private
and public WANs, and across the Internet. Examples of its use include the following:
Benefits of IPSec:
IPSec can play a vital role in the routing architecture required for internet working.
The following are examples of the use of IPSec. IPSec can assure that
IPSec Services
IPSec provides security services at the IP layer by enabling a system to select required
security protocols, determine the algorithm(s) to use for the service(s), and put in place any
cryptographic keys required to provide the requested services.
Two protocols are used to provide security:
Access control
Connectionless integrity
Data origin authentication
Rejection of replayed packets (a form of partial sequence integrity)
Confidentiality (encryption)
Limited traffic flow confidentiality
Security Associations
A key concept that appears in both the authentication and confidentiality mechanisms for
IP is the security association (SA). An association is a one-way relationship between a sender
and a receiver that affords security services to the traffic carried on it.
SA Parameters
A security association is normally defined by the following parameters:
a) Sequence Number Counter:
A 32-bit value used to generate the Sequence Number field in AH or ESP headers.
b) Sequence Counter Overflow:
A flag indicating whether overflow of the Sequence Number Counter should generate an
auditable event and prevent further transmission of packets on this SA.
c) Anti-Replay Window:
Used to determine whether an inbound AH or ESP packet is a replay.
d) AH Information:
Authentication algorithm, keys, key lifetimes, and related parameters being used with AH
(required for AH implementations).
e) ESP Information:
Encryption and authentication algorithm, keys, initialization values, key lifetimes, and
related parameters being used with ESP (required for ESP implementations).
Modes of Transfer
Both AH and ESP support two modes of use: transport and tunnel mode.
Transport Mode:
Transport mode provides protection primarily for upper-layer protocols. That is, transport
mode protection extends to the payload of an IP packet.
Tunnel Mode:
Tunnel mode provides protection to the entire IP packet. To achieve this, after the AH or
ESP fields are added to the IP packet, the entire packet plus security fields is treated as the
payload of new "outer" IP packet with a new outer IP header.
The entire original, or inner, packet travels through a "tunnel" from one point of an IP
network to another; no routers along the way are able to examine the inner IP header. Because
the original packet is encapsulated, the new, larger packet may have totally different source and
destination addresses, adding to the security.
Authentication Header
The Authentication Header provides support for data integrity and authentication of IP
packets. The Authentication Header consists of the following fields:
Next Header (8 bits): Identifies the type of header immediately following this header.
Payload Length (8 bits): Length of Authentication Header in 32-bit words, minus 2.
Reserved (16 bits): For future use.
Security Parameters Index (32 bits): Identifies a security association.
Sequence Number (32 bits): A monotonically increasing counter value.
Authentication Data (variable): A variable-length field (must be an integral number
of 32-bit words) that contains the Integrity Check Value (ICV), or MAC
The Authentication Data field holds a value referred to as the Integrity Check Value. The
ICV is a message authentication code or a truncated version of a code produced by a MAC
algorithm.
Tunnel mode ESP is used to encrypt an entire IP packet. For this mode, the ESP header
is prefixed to the packet and then the packet plus the ESP trailer is encrypted. This method can
be used to counter traffic analysis.
Because the IP header contains the destination address and possibly source routing
directives and hop-by-hop option information, it is not possible simply to transmit the encrypted
IP packet prefixed by the ESP header. Intermediate routers would be unable to process such a
packet.
Therefore, it is necessary to encapsulate the entire block (ESP header plus cipher text
plus Authentication Data, if present) with a new IP header that will contain sufficient information
for routing but not for traffic analysis.
This approach is illustrated in diagram. In this approach, the user first applies ESP to the
data to be protected and then appends the authentication data field. There are actually two
subcases:
Transport mode ESP: Authentication and encryption apply to the IP payload delivered
to the host, but the IP header is not protected.
Tunnel mode ESP: Authentication applies to the entire IP packet delivered to the outer
IP destination address (e.g., a firewall), and authentication is performed at that destination. The
entire inner IP packet is protected by the privacy mechanism for delivery to the inner IP
destination.
For both cases, authentication applies to the cipher text rather than the plaintext.
Transport Adjacency
Another way to apply authentication after encryption is to use two bundled transport
SAs, with the inner being an ESP SA and the outer being an AH SA. In this case, ESP is used
without its authentication option. Because the inner SA is a transport SA, encryption is applied
to the IP payload. The resulting packet consists of an IP header (and possibly IPv6 header
extensions) followed by an ESP.AH is then applied in transport mode,
so that authentication covers the ESP plus the original IP header (and extensions)
except for mutable fields. The advantage of this approach over simply using a single ESP SA
with the ESP authentication option is that the authentication covers more fields, including the
source and destination IP addresses.The disadvantage is the overhead of two SAs versus one
SA.
The lower part of each case in the figure represents the physical connectivity of the
elements; the upper part represents logical connectivity via one or more nested SAs. Each SA
can be either AH or ESP. For host-to-host SAs, the mode may be either transport or tunnel;
otherwise it must be tunnel mode.
Case 1: All security is provided between end systems that implement IPsec.
For any two end systems to communicate via an SA, they must share the appropriate
secret keys. Among the possible combinations are
AH in transport mode
ESP in transport mode
ESP followed by AH in transport mode (an ESP SA inside an AH SA)
Any one of a, b, or c inside an AH or ESP in tunnel mode
We have already discussed how these various combinations can be used to support
authentication, encryption, authentication before encryption, and authentication after encryption.
Case 2: Security is provided only between gateways (routers, firewalls, etc.) and no
hosts implement IPsec. This case illustrates simple virtual private network support. The security
architecture document specifies that only a single tunnel SA is needed for this case. The tunnel
could support AH, ESP, or ESP with the authentication option. Nested tunnels are not required,
because the IPsec services apply to the entire inner packet.
Case 3: This builds on case 2 by adding end-to-end security. The same combinations
discussed for cases 1 and 2 are allowed here. The gateway-to-gateway tunnel provides either
authentication, confidentiality, or both for all traffic between end systems.When the gateway-to-
gateway tunnel is ESP, it also provides a limited form of traffic confidentiality. Individual hosts
can implement any additional IPsec services required for given applications or given users by
means of end-to-end SAs.
Case 4: This provides support for a remote host that uses the Internet to reach an
organization‟s firewall and then to gain access to some server or workstation behind the firewall.
Only tunnel mode is required between the remote host and the firewall. As in case 1, one or two
SAs may be used between the remote host and the local host.
KEY MANAGEMENT
The key management portion of IPSec involves the determination and distribution of
secret keys. Two types of key management:
Manual: A system administrator manually configures each system with its own keys and
with the keys of other communicating systems. This is practical for small, relatively static
environments.
Automated: An automated system enables the on-demand creation of keys for SAs and
facilitates the use of keys in a large distributed system with an evolving configuration.
The default automated key management protocol for IPSec is referred to as
ISAKMP/Oakley and consists of the following elements:
Oakley Key Determination Protocol: Oakley is a key exchange protocol based on the
Diffie-Hellman algorithm but providing added security. Oakley is generic in that it does not
dictate specific formats.
Internet Security Association and Key Management Protocol (ISAKMP):ISAKMP
provides a framework for Internet key management and provides the specific protocol support,
including formats, for negotiation of security attributes.
(firewall, router).These are illustrated in Figure .The lower part
Digital signatures
Public-key encryption
Symmetric-key encryption
ISAKMP
ISAKMP defines procedures and packet formats to establish, negotiate, modify, and
delete security associations.
ISAKMP Header Format
An ISAKMP message consists of an ISAKMP header followed by one or more payloads.
It consists of the following fields:
Initiator Cookie (64 bits): Cookie of entity that initiated SA establishment, SA
notification, or SA deletion.
Responder Cookie (64 bits): Cookie of responding entity; null in first message
from initiator.
Next Payload (8 bits): Indicates the type of the first payload in the message;
payloads are discussed in the next subsection.
Major Version (4 bits): Indicates major version of ISAKMP in use.
Minor Version (4 bits): Indicates minor version in use.
Exchange Type (8 bits): Indicates the type of exchange.
Flags (8 bits): Indicates specific options set for this ISAKMP exchange.
Message ID (32 bits): Unique ID for this message.
Length (32 bits): Length of total message (header plus all payloads) in octets.