CNS UNIT-4
CNS UNIT-4
E-Mail SECURITY
PRETTY GOOD PRIVACY
PGP is an open-source, freely available software package for e-mail security. It
provides authentication through the use of digital signature, confidentiality
through the use of symmetric block encryption, compression using the ZIP
algorithm, and e-mail compatibility using the radix-64 encoding scheme.
Notations:
Ks = session key used in symmetric encryption scheme
PRa = private key of user A, used in public-key encryption scheme
PUa = public key of user A, used in public-key encryption scheme
EP = public-key encryption
DP = public-key decryption
EC = symmetric encryption
DC = symmetric decryption
H = hash function
|| = concatenation
1
Operational description:
The actual operation of PGP, as opposed to the management of keys, consists of
four services: authentication, confidentiality, compression, and e-mail
compatibility.
Authentication:
The sequence of steps as follows
1. The sender creates a message.
2. SHA-1 is used to generate a 160-bit hash code of the message.
3. The hash code is encrypted with RSA using the sender’s private key, and
the result is prepended to the message.
4. The receiver uses RSA with the sender’s public key to decrypt and
recover the hash code.
5. The receiver generates a new hash code for the message and compares it
with the decrypted hash code. If the two match, the message is accepted
as authentic.
CONFIDENTIALITY Another basic service provided by PGP is confidentiality,
which is provided by encrypting messages to be transmitted or to be stored
locally as files
The sequence is as follows.
2
1. The sender generates a message and a random 128-bit number to be used
as a session key for this message only.
2. The message is encrypted using CAST-128 (or IDEA or 3DES) with the
session key.
3. The session key is encrypted with RSA using the recipient’s public key
and is prepended to the message.
4. The receiver uses RSA with its private key to decrypt and recover the
session key.
5. The session key is used to decrypt the message.
3
Thus, part or all of the resulting block consists of a stream of arbitrary
8-bit octets.
However, many electronic mail systems only permit the use of blocks
consisting of ASCII text.
To accommodate this restriction, PGP provides the service of converting
the raw 8-bit binary stream to a stream of printable ASCII characters.
4
S/MIME (Secure/Multipurpose Internet Mail Extensions)
S/MIME is a security enhancement to the MIME Internet e-mail format
standard based on technology from RSA Data Security.
Multipurpose Internet Mail Extension (MIME) is an extension to the RFC 5322
framework that is intended to address some of the problems and limitations of
the use of Simple Mail Transfer Protocol (SMTP), defined in RFC 821, or some
other mail transfer protocol and RFC 5322 for electronic mail. [PARZ06] lists
the following limitations of the SMTP/5322 scheme.
SMTP cannot transmit executable files or other binary objects.
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.
SMTP servers may reject mail message over a certain size.
SMTP gateways that translate between ASCII and the character code
EBCDIC do not use a consistent set of mappings, resulting in translation
problems.
SMTP gateways to X.400 electronic mail networks cannot handle non-
textual data included in X.400 messages.
Header fields in MIME:
IP SECURITY OVERVIEW
IP security (IPsec) is a capability that can be added to either current
version of the Internet Protocol (IPv4 or IPv6) by means of additional headers.
IPsec encompasses three functional areas: authentication, confidentiality, and
key management.
In 1994, the Internet Architecture Board (IAB) issued a report titled
“Security in the Internet Architecture”
To provide security, the IAB included authentication and encryption as
necessary security features in the next-generation IP, which has been issued as
5
IPv6. Fortunately, these security capabilities were designed to be usable both
with the current IPv4 and the future IPv6.
Applications of IPsec
6
are used. These protocols operate in networking devices, such as a router or
firewall, that connect each LAN to the outside world.
Benefits of IPsec
Some of the benefits of IPsec:
When IPsec is implemented in a firewall or router, it provides strong
security that can be applied to all traffic crossing the perimeter. Traffic
within a company or workgroup does not incur the overhead of security-
related processing.
IPsec in a firewall is resistant to bypass if all traffic from the outside
must use IP and the firewall is the only means of entrance from the
Internet into the organization.
IPsec is below the transport layer (TCP, UDP) and so is transparent to
applications.
IPsec can be transparent to end users.
IPsec can provide security for individual users if needed.
Routing Applications
Router advertisement (a new router advertises its presence) comes from
an authorized router.
A neighbor advertisement (a router seeks to establish or maintain a
neighbour relationship with a router in another routing domain) comes
from an authorized router.
A redirect message comes from the router to which the initial IP packet
was sent.
A routing update is not forged.
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.
Access control
Connectionless integrity
Data origin authentication
Rejection of replayed packets (a form of partial sequence integrity)
Confidentiality (encryption)
Limited traffic flow confidentiality
IP SECURITY ARCHITECTURE
7
IPSec (IP Security) architecture uses two protocols to secure the traffic or
data flow. These protocols are ESP (Encapsulation Security Payload) and AH
(Authentication Header). IPSec Architecture includes protocols, algorithms,
DOI, and Key Management. All these components are very important in order to
provide the three main services:
Confidentiality
Authentication
Integrity
8
Packet Format:
9
Authentication Header covers the packet format and general issues related to
the use of AH for packet authentication and integrity.
AUTHENTICATION HEADER
Transport mode
Tunnel mode
10
Time to live (TTL)
Header checksum
To protect these fields, tunnelling must be used. The payload of the IP packet
is considered immutable and is always protected by AH.
AH format
The AH format is described in RFC 2402. The below shows the position of the
Authentication Header fields in the IP packet.
11
Payload length
It is an 8 bits long field and contains the length of the AH header expressed in
32-bit words, minus 2. It does not relate to the actual payload length of the IP
packet. Suppose if default options are used, the value is 4 (three 32-bit fixed
words plus three 32-bit words of authentication data minus two).
Reserved
It is reserved for future use. Its length is 16 bits and it is set to zero.
Security parameter index (SPI)
It is 32 bits in length.
Sequence number
This 32-bit field is a monotonically increasing counter, which is used for replay
protection. It is an optional field. The sender always includes this field, and it is
at the discretion of the receiver to process it or not. Starting the sequence
number is initialized to zero. The first packet transmitted using the SA has a
sequence number of 1. Sequence numbers are not allowed to repeat.
Authentication data
This is a variable-length field containing the Integrity Check Value (ICV), and is
padded to 32 bits for IPv4 or 64 bits for IPv6.
ESP Format
Figure 19.5a shows the top-level format of an ESP packet. It contains the
following fields.
12
Integrity Check Value (variable): A variable-length field (must be an
integral number of 32-bit words) that contains the Integrity Check Value
computed over the ESP packet minus the Authentication Data field.
Padding
13
Anti-Replay Service
Figure 19.7 shows two ways in which the IPsec ESP service can be used. In the
upper part of the figure, encryption (and optionally authentication) is provided
directly between two hosts. Figure 19.7b shows how tunnel mode operation can
be used to set up a virtual private network.
14
configuration allows the hosts to avoid implementing the security capability. The
former technique is supported by a transport mode SA, while the latter
technique uses a tunnel mode SA.
An individual SA can implement either the AH or ESP protocol but not both.
Sometimes a particular traffic flow will call for the services provided by both
AH and ESP.
15
The two approaches can be combined, for example, by having a transport SA
between hosts travel part of the way through a tunnel SA between security
gateways.
16
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.
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.
KEY MANAGEMENT
17
communication between two applications: transmit and receive pairs for both
integrity and confidentiality. The IPsec Architecture document mandates
support for 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.
ISAKMP provides a framework for Internet key management and provides the
specific protocol support, including formats, for negotiation of security
attributes.
18
Responder SPI (64 bits): A value chosen by the responder to identify a
unique IKE SA.
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 IKE in use.
Minor Version (4 bits): Indicates minor version in use.
Exchange Type (8 bits): Indicates the type of exchange; these are discussed
later in this section.
• Flags (8 bits): Indicates specific options set for this IKE exchange. Three
bits are defined so far. The initiator bit indicates whether this packet is sent
by the SA initiator. The version bit indicates whether the transmitter is
capable of using a higher major version number than the one currently indicated.
The response bit indicates whether this is a response to a message containing
the same message ID.
• Length (32 bits): Length of total message (header plus all payloads) in octets
19