Unit 5 CNS
Unit 5 CNS
Unit 5 CNS
Hackers can easily circumvent the protection offered by a firewall by tunneling through
the email protocol, since it does not analyze email content.
This benefits in saving space both for storage as well as for transmission of
email message.
The signature is generated before compression for reasons below :
In order to store uncompressed message together with the signature for future
verification. If it would have had compressed before signing then later verification is difficult.
Because PGP.s compression algorithm is not deterministic; various implementations achieve
different tradeoffs in running speed versus compression ratio and , as a result produces different
compressed forms. Applying hash and signature after compression would result in invalid
authentication.
The Message encryption is applied after compression:
to strengthen cryptographic security. Because the compressed message has less
redundancy than original plaintext. Cryptanalysis is difficult.
Email Compatibility
The data generated via encryption, signature, hash and Zip functions consists of a stream
of arbitrary 8-bit octets.
However, many email systems only permit the use of blocks consisting of ASCII text (7-bit data).
To overcome the situation 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 3 octets of binary data
is mapped into 4 ASCII characters. The use of radix-64 expands a message by 33%.
This scheme is very much useful in achieving certain level of confidentiality when a message is
signed but not encrypted.
The output will be unreadable to the third party. As an option, PGP can be configured to convert
to radix-64 format only the signature portion of the signed plaintext messages.
Segmentation and Reassembly
Email systems has certain restrictions related to maximum email message length to be
transmitted.
For example, some of the facilities impose a maximum length of 50,000 octets. Any message
longer than that must be broken up into smaller segments each of which is mailed separately.
Thus, the session key component and signature component appear only once, at the
beginning of the first segment.
At the receiving end, PGP must strip off all email headers and reassemble the entire
original block.
General Format of PGP Message
The Message format of PGP includes 3 components:
Message
Signature
Session key component
Message includes actual data to be stored or
transmitted as well as a file name that includes
control information generated by PGP and a
timestamp that corresponds to the time of creation.
The session key component Radix-64 example: Suppose that out non-ASCII data that
includes the session key (Ks) needs to be converted into
and identifiers of recipients ASCII using Base-64 encoding is :
public key (KUb) that was used 10011011 10100010 11101001.
by the sender to encrypt the using 8-bit ASCII i.e. 155, 162, 233 in decimal.
session key. The entire block is After conversion to 6-bit ASCII the sequence is
usually encoded with radix-64 100110-38 in decimal, .m. as per radix-64
encoding. 11101058 in decimal, .6. as per radix -64
00101111 in decimal .L. as per radix -64
10100141 in decimal .p. as per radix-64
Hence, our original non-ASCII text of 155, 162 and 233 in
decimal
would be sent as .m6Lp.
S/MIME
S/MIME was developed by RSA to prevent forgery and interception of electronic
messages. S/MIME was created on the existing MIME protocol standard and it can be
integrated easily into the existing email and messaging products.
S/MIME is very similar to PGP. Both offer the ability to sign and/or encrypt messages.
S/MIME provides cryptographic security services for email applications such as:
message integrity,
authentication, and
non-repudiation of origin,
privacy, and data security.
The functionality of S/MIME is built into the vast majority of recent editions of email
software including Gmail, Outlook Express, Apple Mail, Mozilla Thunderbird, Lotus
Notes, Netscape Communicator, Gnus, KMail, Balsa, and Sun Java Messaging.
MIME Header: MIME version : This contains MIME version
MIME defines 5 headers that can be added number i.e. 1.1
to the original e-mail header: Content-Type: Describes the data contained in
1. MIME version the body of the message. The details provided
2. Content-type are sufficient so that the receiver email system
3. Content-Transfer encoding can deal with the received email message in an
4. Content-ID appropriate manner.
5. Content description The contents are specified as : Type / subtypes.
MIME specifies 7 content type and 15 content
subtypes.
Content-Transfer Encoding: Specifies the type of transformations that has been used to
represent the body of the message.
7-bit ASCII characters and short lines.
8-bitNon-ASCII Characters short lines
Binary Non-ASCII characters with unlimited-length lines.
Base-64 6-bit blocks of data encoded into 8-bit ASCII characters
Quoted-printable Non-ASCII characters encoded as an equal to sign. Followed by an
MIME Header Contd…
The SSL Record Protocol provides basic security services to various higher-
layer protocols.
In particular, the hypertext transfer protocol (HTTP), which provides the transfer
service for Web client/server interaction, can operate on top of SSL.
Session: An SSL session is an association between a client and a server. Sessions are
created by the Handshake Protocol. Sessions define a set of cryptographic security
parameters, which can be shared among multiple connections. Sessions are used to
avoid the expensive negotiation of new security parameters for each connection.
SSL Record Protocol
The SSL Record Protocol
provides two services for SSL
connections:
Confidentiality: The
Handshake Protocol defines a
shared secret key that is used
for
conventional encryption of SSL
payloads.
Message Integrity: The
Handshake Protocol also
defines a shared secret key that
is
used to form a message
authentication code (MAC)
SSL Record Protocol Contdd… Change Cipher Spec Protocol
Figure indicates the overall operation of the The Change Cipher Spec Protocol is
SSL Record Protocol. The Record Protocol one of the three SSL-specific protocols
takes an application message to be that use the SSL
transmitted, fragments the data into Record Protocol, and it is the simplest.
manageable blocks, optionally compresses This protocol consists of a single
the data, applies a MAC, encrypts, adds a message, which consists of a single
header, and transmits the resulting unit in a byte with the value 1. The sole purpose
TCP segment. Received data are of this message is to cause the
decrypted, verified, decompressed, and pending state to be copied into the
reassembled and then delivered to higher- current state, which updates the cipher
level users. suite to be used on this connection.
Alert Protocol Handshake Protocol
The Alert Protocol is used to convey SSL- The most complex part of SSL is the
related alerts to the peer entity. As with Handshake Protocol. This protocol
other applications that use SSL, alert allows the server and client to
messages are compressed and encrypted, authenticate each other and to
as specified by the current state. negotiate an encryption and MAC
Each message in this protocol consists of algorithm and cryptographic keys to
two bytes. The first byte takes the value be used to protect data sent in an
warning (1) or fatal (2) to convey the SSL record.
severity of the message. If the level is fatal,
SSL immediately terminates the The handshake protocol
connection. Other connections on the same is used before any application data is
session may continue, but no new transmitted.
connections on this session may be
established. The Handshake Protocol consists of
a series of messages exchanged by
client and server.
SSL Handshake Protocol Message Types
Version Number
The TLS Record Format is the same as that of the SSL Record Format
Message Authentication Code
There are two differences between the SSLv3 and TLS MAC schemes: the actual algorithm
and the scope of the MAC calculation. TLS makes use of the HMAC algorithm defined in
RFC 2104.
Pseudorandom Function
TLS makes use of a pseudorandom function referred to as PRF to expand secrets into blocks
of data for purposes of key generation or validation. The objective is to make use of a
relatively small shared secret key.
To make PRF as secure as possible, it uses two hash algorithms in a way that should
guarantee its security if either algorithm remains secure.
Alert Codes
TLS supports all of the alert codes defined in SSLv3 with the exception of
no_certificate. A number of additional codes are defined in TLS and a few are
here:
decryption_failed: A ciphertext decrypted in an invalid way; either it was
not an even multiple of the block length or its padding values, when checked,
were incorrect.
record_overflow: A TLS record was received with a payload (ciphertext) whose
length exceeds 214 + 2048 bytes, or the ciphertext decrypted to a length of greater
than 214 1 1024 bytes.
unknown_ca: A valid certificate chain or partial chain was received, but the
certificate was not accepted because the CA certificate could not be located or could
not be matched with a known, trusted CA.
access_denied: A valid certificate was received, but when access control was
applied, the sender decided not to proceed with the negotiation.
IP Security
Need for IP Security
There are systems that provide security at application layer (PGP, S/MIME)
Systems that provide security at transport layer (SSL,TLS,SSH), for establishing a secure
connection between a client and a server.
TLS (Transport Layer Security) is capable of authenticating both the client and the
server and creating a encrypted connection between the two.
Need for IP Security Contd…
However the security at above two layers are may not be enough in some cases:
Not all client/server programs are protected at the application layer Eg. PGP and S/MIME
protect only email application.
Not all client/server programs at the application layer use the services of TCP (Transport
layer) to be protected by SSL or TLS. Some programs use the service of UDP.
Many applications, such as routing protocols, directly use the service of IP, and the most
serious types of attacks included IP Spoofing, in which intruders create packets with
false IP addresses and exploit applications that use authentication based on IP address,
and various forms of eavesdropping and packet sniffing, in which attackers read
transmitted information, including logon information and database contents.
For all the above reasons security services are needed at the IP layer
IP Security Overview
IPsec is an extension to the IP protocol
which provides security to the IP and the
upper layer protocols.
It was first developed for the new IPv6
standard and then “backported” to IPv4.
The IPsec architecture is described in the
RFC2401.
In order to ensure the security of Internet,
Internet Architecture Board (IAB), in 1994
issued a report stating the issues and
mechanisms to secure the network
infrastructure from unauthorized
monitoring and control of network
traffic and the need to secure end user-
to-end-user traffic using authentication
and encryption.
IP Header: General IP Header
IPSec Header: Also called authentication header, provides integrity protection,
authentication.
Secure IP Payload: Called Encapsulating Security Payload(ESP), provides optional
integrity protection and optional encryption.
Applications of IPsec
IP security provides the capability to secure communication across a LAN, across private
and public WAN‟s and Internet.
1. A company can build a secure virtual private network over the Internet or over a
public WAN. Advantage: - cost reduction and minimizing overhead.
Encryption algorithm This defines various encryption algorithms used for ESP.
Authentication Algorithm This defines how various authentication algorithms are used
for AH and for the authentication option of ESP.
Security Parameters Index (32bits): Identifies a SA to use for the decapsulation of the
ESP packet. The receiver uses this value to determine the security association with
which this packet should be identified. This works like port numbers in TCP and UDP
connections.
Sequence Number (32 bits): A monotonically increasing counter value. This sequence
number is used to protect against replay attacks. The receiver checks this field to
verify that a packet for a security association with this number has not been received
already. If one has been received, the packet is rejected.
Payload Data (variable): A transport-level segment (transport mode) or IP packet
(tunnel mode) that is protected by encryption.
Next Header (8 bits): Identifies the type of data contained in the payload data field by
identifying the first header in that payload. Identifies the nature of the payload, such
as TCP or UDP.
Authentication Data (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. The length of the field is specified by the
authentication function selected. This field is optional, and is included only if the
authentication service has been selected for the SA in question.
ESP provides protection for upper layer protocols. The Signed area indicates where the
packet has been signed for integrity. The Encrypted area indicates what information is
protected with confidentiality.
Authentication header
The Authentication Header (AH) protocol provides data origin authentication, data
integrity, and replay protection. However, AH does not provide data confidentiality, which
means that all of your data is sent in the clear.
The Internet Engineering Task Force (IETF) formally defines AH in Request for Comment
(RFC) 2402, IP Authentication Header.
The following AH packet diagram shows how an AH packet is constructed and interpreted
Next header
The Next Header is an 8-bit field that identifies the type of the next payload
after the Authentication Header..
Payload length
Size of AH packet.
RESERVED
Reserved for future use (all zero until then).
Security parameters index (SPI)
Identifies the security parameters, which, in combination with the IP address,
then identify the security association implemented with this packet.
Sequence number
A monotonically increasing number, used to prevent replay attacks.
Authentication data
Contains the integrity check value (ICV) necessary to authenticate the packet;
it may contain padding.
IP Security Policy
An IPSec policy is nothing more than a set of rules that govern when and how Windows uses
the IPSec protocol. The IPSec policy interacts directly with the IPSec driver. The policy tells
Windows such things as which data to secure IPSec policies work by determining which IP
traffic should be secured and which IP packets should be left alone and which security
method to use. This is accomplished through the use of an IP filter list, individual IP filters,
and filter actions.
Then, provide the IPSec policies with some information about your network. This
information may include things like the security method to use, the connection type, and the
tunnel settings.
The security method simply dictates which security algorithms should be used during the
authentication process and which algorithms should be used for key exchanges. The
connection type refers to whether the policy should be applied to remote access
connections,
LAN connections, or all network connections regardless of the type. The tunnel settings are
only used if you‟re using IPSec over a virtual private network. The tunnel settings define the
DNS name or the IP address of the tunnel’s end point.
Internet Key Exchange (IKE)
The IPSec ESP and AH protocols provide integrity and authentication of IP
packets, but they are not the complete package.
IETF includes a protocol that provides several services, including:
Negotiating which protocols, algorithms, and keys will be used in a
communication
verifying the identity of the other party; and
Managing and exchanging keys.
The key management portion of IPSec involves the determination and
distribution of secret keys.
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.
Automated : An automated system enables the on-demand creation of keys
for SA’s and facilitates the use of keys in a large distributed system with an
evolving configuration. An automated system is the most flexible but
requires more effort to configure and requires more software, so smaller
installations are likely to opt for manual key management.
The Two protocols of IPSec, the Internet Security Association and key
Management protocol (ISAKMP) / Oakley key exchange protocol
automatically handles exchange of secret symmetric keys between sender and
receiver.
ISAKMP:
- a protocol to establish a framework of authentication and key
exchange.- is based on Diffie- Hellman model of key generation, in which the
two parties share information beforehand to ensure the identity of the other
party.
- Defines procedures and provides a framework for Internet key
management packet formats to establish, negotiate, modify and delete
Security Associations.
by itself does not dictate a specific key exchange algorithm; rather,
ISAKMP consists of a set of message types that enable the use of a
variety of key exchange algorithms.
Oakley:
- which describes a series of key exchange defining in detail the services
provided by them
- The Oakley Key Determination Protocol is a key-agreement protocol
that allows authenticated parties to exchange keying material across an
insecure connection using the Diffie-Hellman key exchange algorithm.