Unit 5 Cns
Unit 5 Cns
UNIT V
E-MAIL, IP & WEB SECURITY
E-mail Security: Security Services for E-mail-attacks possible through E-mail - establishing keys
privacy-authentication of the source-Message Integrity-Non-repudiation-Pretty Good Privacy-
S/MIME. IPSecurity: Overview of IPSec - IP and IPv6-Authentication Header-Encapsulation Security
Payload (ESP)-Internet Key Exchange (Phases of IKE, ISAKMP/IKE Encoding). Web Security:
SSL/TLS Basic Protocol-computing the keys- client authentication-PKI as deployed by SSLAttacks
fixed in v3-Exportability-Encoding-Secure Electronic Transaction (SET).
PGP has grown explosively and is now widely used. A number of reasons can be cited for this growth:
1. It is available free worldwide in versions that run on a variety of platforms.
2. It is based on algorithms that are extremely secure.
3. It has a wide range of applicability.
4. It was not developed by, nor is it controlled by, any governmental or standards organization
5. PGP is now on an Internet standards track.
Operational Description
(i) Authentication
(ii) Confidentiality
(iii) Compression
(iv) E-Mail compatibility
(v) Segmentation
(i) Authentication
The sender creates a message.
SHA-1 is used to generate a 160-bit hash code of the message.
The hash code is encrypted with RSA using the sender's private key, and the result is
prepended to the message.
The receiver uses RSA with the sender's public key to decrypt and recover the hash
code.
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.
(ii) Confidentiality
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 (or IDEA or 3DES) with the session key.
The session key is encrypted with RSA, using the recipient'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.
(iv) Compression
PGP compresses the message after applying the signature but before encryption. The compression
algorithm is indicated by Z for compression and Z-1 for decompression. The signature is generated before
compression for two reasons:
a) It is preferable to sign an uncompressed message so that one can store only the uncompressed
message together with the signature for future verification.
b) Even if one were willing to generate dynamically a recompressed message for verification, PGP's
compression algorithm presents a difficulty. The algorithm is not deterministic.
c) 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.
S/MIME
S/MIME is a security enhancement to MIME. S/MIME will emerge as the industry standard for
commercial and organizational use.
To understand the S/MIME, we need first to have a general understanding of the e-mail format RFC822.
RFC822
RFC 822 defines a format for text messages that are sent using e-mail. InRFC 822 messages are said to
have an envelope and contents.
Envelop: Information needed for transmission and delivery is present.
Content: It contains the object to be delivered to the receiver.
Each line in the header consists of a keyword such as From, To, Subject, Date. The following are
the limitations of SMTP/RFC 82 scheme.
SMTP cannot transmit executable or other binary data.
SMTP cannot transmit text data that includes natural language characters.
SMTP server may reject mail message over a certain type
Overview of MIME
1. Five new message header fields are defined, which may be included in an RFC 822 header.
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.
Content-Type
There are seven different major types of content and total of 15 subtypes.
S/MIME functionality
S/MIME provides the following functions
Enveloped Data: This consists of encrypted content of any type and encrypted content encryption keys
for one or more recipients.
Signed Data: A digital signature is formed by taking the message digest of the content to be signed and
then encrypting that with the private key of the signer. The content plus signature are then encoded
using base 64 encoding.
Clear-signed Data: The digital signature is encoded using base64. As a result recipients without
S/MIME capability can view the message content, although they cannot verify the signature.
Signed and enveloped data: Signed only and encrypted only entities may be nested, so that encrypted
data may be signed.
S/MIME messages
SignedData
The steps for preparing a signedData MIME entity are as follows:
1. Select a message digest algorithm.
2. Compute the message digest, or hash function, of the content to be signed.
3. Encrypt the message digest with the signer's private key.
4. Prepare a block known as SignerInfo that contains the signer's public-key certificate, an identifier of
the message digest algorithm, an identifier of the algorithm used to encrypt the message digest, and the
encrypted message digest.
VeriSign Certificates
VeriSign provides a 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. 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
IP Sec
IPSec provides the capability to secure communications across a LAN, across private and public WANs,
and across the Internet. Examples are
Secure branch office connectivity over the Internet
Secure remote access over the Internet
Establishing extranet and intranet connectivity with partners
Enhancing electronic commerce security
IP Security Architecture
The IPSec specification consists of numerous documents. The most important of these, issued in
November of 1998, are
RFC 2401: An overview of a security architecture
RFC 2402: Description of a packet authentication extension to IPv4 and IPv6
RFC 2406: Description of a packet encryption extension to IPv4 and IPv6
RFC 2408: Specification of key management capabilities
Architecture: Covers the general concepts, security requirements, definitions, and mechanisms
defining IPSec technology.
Encapsulating Security Payload (ESP): Covers the packet format and general issues related to the
use of the ESP for packet encryption and, optionally, authentication.
Authentication Header (AH): Covers the packet format and general issues related to the use of AH
for packet authentication.
Encryption Algorithm: A set of documents that describe how various encryption algorithms are used
for ESP.
Authentication Algorithm: A set of documents that describe how various authentication algorithms
are used for AH and for the authentication option of ESP.
Key Management: Documents that describe key management schemes.
Domain of Interpretation (DOI): This document contains values needed for other documents to relate
to each other.
IPSec Services
IPSec provides security services at the IP layer by enabling a system to select required security
protocols. Two protocols are used to provide security:
Authentication protocol
Encryption/authentication protocol (ESP). The services are
The services are
Access control
Connectionless integrity
SA Parameters
A security association is normally defined by the following parameters:
Sequence Number Counter: A 32-bit value used to generate the Sequence Number field in AH or ESP
headers.
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.
Anti-Replay Window: Used to determine whether an inbound AH or ESP packet is a replay or not.
AH Information: Specifies an authentication related parameters like authentication algorithm,
authentication key, and key lifetimes.
ESP Information: Specifies the encryption and authentication algorithm, keys, initialization values,
key lifetimes
Lifetime of this SA: This is the time interval after which SA must be replaced with a new SA.
IPSec Protocol Mode: This parameter specifies the mode of transfer.
Path MTU: Specifies the maximum transmission unit.
SA Selectors
IPSec provides the user with flexibility in the way in which IPSec services are applied to IP traffic. The
means by which IP traffic is related to specific SAs is the nominal Security Policy Database (SPD).
SPD contains entries, each of which defines a subset of IP traffic and points to an SA for that traffic.
Each SPD entry is defined by a set of IP and upper-layer protocol field values, called selectors. These
selectors are used to filter outgoing traffic in order to map it into a particular SA.
The following selectors determine an SPD entry:
Destination IP Address
Source IP Address
UserID
Data Sensitivity Level
Transport Layer Protocol
Source and Destination Ports
Modes of Transfer
Transport Mode
Tunnel Mode
Transport Mode
Transport mode provides protection primarily for upper-layer protocols. The transport mode protection
extends to the payload of an IP packet. Transport mode is used for end to end connections.
Tunnel Mode
Tunnel mode provides protection to the entire IP packet. Tunnel mode authenticates the entire inner IP
and selected portion of outer IP header, IP V6 extension header.
AUTHENTICATION HEADER
The Authentication Header provides data integrity and authentication of IP packets. The data integrity
assures that modification during transit is not possible. The authentication enables the system to
authenticate the user and prevents the address spoofing attacks.
IP Authentication Header
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 which contains the Integrity Check Value.
Anti-Replay Service
A replay attack is one in which an attacker obtains a copy of an authenticated packet and later transmits
it to the intended destination. The Sequence Number field is designed to overcome such attacks.
Transport mode AH
The AH is inserted after the original IP header and before the IP payload.
Tunnel Mode of AH
The entire original IP packet is authenticated and the AH is inserted between the orginal IP header and
new IP header.
10
11
KEY MANAGEMENT
The key management portion of IPSec involves the determination and distribution of secret keys. The
IPSec support 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.
Automated: This system supports on-demand creation of keys for SAs and supports use of large
system. The automated key management protocol for IPsec is called ISAKMP/Oakly.
ISAKMP
ISAKMP defines procedures and formats to establish, negotiate, modify, and delete security
associations. ISAKMP defines payload for exchanging key generation and authentication data.
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.
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.
12
ISAKMP messages
Responder-Lifetime: Communicates the SA lifetime chosen by the responder.
Replay-Status: Used for positive confirmation of the responder's election of whether or not the
responder will perform anti-replay detection.
Initial-Contact: Informs the other side that this is the first SA being established with the remote system.
The Delete payload: Indicates that the sender has deleted the SA from its database.
13
ISAKMP Exchanges
The Base Exchange: Allows key exchange and authentication to be transmitted together.
The Identity Protection Exchange: Expands the base to protect the users' identities.
The Authentication Only Exchange: Used to perform mutual authentication, without a key exchange.
The Aggressive Exchange: Provides identity protection.
The Informational Exchange: Used for one-way transmittal of information for SA management.
WEB SECURITY
The web security threats can be found in web security, web browser and the network traffic between
the browser and server.
This approach is transparent to end users and provides a general purpose solution. IPSec data filtering,
so that only selected traffic can incur IPSec processing.
Approach 2
Implement the security above TCP. SSL can be embedded with SSL to Netscape Navigator, Microsoft
explorer.
Approach 3
Security services are embedded in a particular application. SET is an example of this approach.
14
IPV4
Internet protocol being a layer-3 protocol takes data segments from layer-4 and divides in to packets.
IP packets encapsulates data unit received from above layer and add to its own header information.
Version: This Field defines the version of IP. It is Static 4 bit value.
Header Length: This Field defines the length of the entire IP header. It is 4 bit value.
Type of Service: It is 8 bit value. It is used tell the network how to treat the IP packet. These bits are
generally used to indicate the Quality of Service (QoS) for the IP Packet.
Packet Length: Length of the entire IP packet.
Identification: Used to identify the original IP packet.
Flags: It is 3 bits value. Flag tells the whether the IP packet is fragmented or not.
Fragment offset: 13 bit value tells the exact position of the fragment in the original IP packet.
Time to Live: 8 bit value. To avoid looping on the network every packet is sent with some TTL value
set, which tell the network how many routers this packet can cross.
Protocol: 8 bit value used to indicate the type of protocol being used.
Header checksum: It is 16 bit value. It is used to indicate errors in the header only.
Source address: 32 bit value representing the IP address of the sender of the IP packet.
Destination address: 32 bit value representing the IP address of the packets final destination.
Options: Options are not required for every datagram. They are used for network testing and debugging.
Padding: Variable size bit field. These bits are used to ensure a 32 bit boundary for the header is
achieved.
IPv6
IPV6 is the most recent version of the Internet Protocol. It is a communication protocol that provides
an identification and location for computers on networks and routes traffic across the network. IPV6 is
developed by IETF – Internet Engineering Task Force.
15
Extension Header
Routing – Extended routing, such as IPv4 loose source route
Fragmentation – Fragmentation and reassembly
Authentication – Integrity and authentication, and security
Encapsulating Security Payload – Confidentiality
Hop-by-Hop options – Special options that require hop-by-hop processing
Destination options – Optional information to be examined by the destination node
SSL Architecture
The SSL Record Protocol provides basic security services to various higher-layer protocols. Three higher
layer protocols are part of SSL viz
Handshake Protocol,
Change Cipher Spec Protocol,
Alert Protocol
SSL concepts
Two important SSL concepts are
SSL session
SSL connection
16
The Record Protocol takes an application message to be transmitted, fragments the data into manageable
blocks, optionally compresses the data, applies a MAC, encrypts, adds a header, and transmits the
resulting unit in a TCP segment. Received data are decrypted, verified, decompressed, and reassembled
and then delivered to higher-level users.
17
Alert Protocol
The Alert Protocol is used to convey SSL-related alerts to the peer entity. The SSL messages are
compressed and encrypted, as specified by the current state. The alerts are
unexpected_message: An inappropriate message was received.
bad_record_mac: An incorrect MAC was received.
decompression_failure: The decompression function received improper input handshake_failure:
Sender was unable to negotiate an acceptable set of security parameters given the options available.
Handshake Protocol
The Handshake Protocol consists of a series of messages exchanged by client and server
Phase 1: Establish Security Capabilities
This phase is used to initiate a logical connection and to establish the security capabilities that will be
associated with it. The exchange is initiated by the client by sending the ‘client hello’ message. It
contains the
Version
Random
Session id
Cipher Suite
Compression Method
The server also sends a ‘server hello’ message to the client.
18
Phase 4. Finish
The client sends a change_cipher_spec message and copies the pending CipherSpec into the
current CipherSpec. The client then immediately sends the finished message under the new algorithms,
keys, and secrets. The finished message verifies that the key exchange and authentication processes
were successful.
In response to these two messages, the server sends its own change_cipher_spec message,
transfers the pending to the current CipherSpec, and sends its finished message. Now, the handshake is
complete and the client and server exchange data.
19