Unit-4-Part-2 and UNIT 5
Unit-4-Part-2 and UNIT 5
Sockets Layer (SSL) and the follow-on Internet standard known as Transport Layer Security (TLS).
SSL Architecture
SSL is designed to make use of TCP to provide a reliable end-to-end secure service. SSL is not a single protocol
but rather two layers of protocols.
The SSL Record Protocol provides basic security services to various higher layer protocols.
Two important SSL concepts are the SSL session and the SSL connection.
• SSL Connection: A connection is a transport that provides a suitable type of service. For SSL, such connections
are peer-to-peer relationships. The connections are transient. Every connection is associated with one session.
• 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.
Step 1 is fragmentation. Each upper-layer message is fragmented into blocks of 214 bytes.
Step 2 Compression must be lossless.
Step 3 and Step 4 is to compute a message authentication code over the compressed data. For this purpose, a
shared secret key is used. The calculation is defined as
This protocol consists of a single message, which consists of a single byte with the value 1. The sole purpose of
this message is to cause the pending state to be copied into the current state, which updates the cipher suite to be
used on this connection.
Alert protocol
FATAL ALERTS
WARNING ALERTS.
• close_notify: Notifies the recipient that the sender will not send any more messages on this connection. Each
party is required to send a close_notify alert before closing the write side of a connection.
• no_certificate: May be sent in response to a certificate request if no appropriate certificate is available.
bad_certificate: A received certificate was corrupt (e.g., contained a signature that did not verify).
• unsupported_certificate: The type of the received certificate is not supported.
• certificate_revoked: A certificate has been revoked by its signer.
• certificate_expired: A certificate has expired.
• certificate_unknown: Some other unspecified issue arose in processing the certificate.
Handshake protocol
This protocol allows the server and client to authenticate each other and to negotiate an encryption and
MAC algorithm and cryptographic keys to be used to protect data sent in an SSL record.
• Type (1 byte): Indicates one of ten messages.
• Length (3 bytes): The length of the message in bytes.
• Content : The parameters associated with this message.
Phase 1 This phase is used to initiate a logical connection and to establish the security capabilities that will
Establish be associated with it.
Security The exchange is initiated by the client, which sends a client_hello message with the following
Capabilities parameters:
• Version: The highest SSL version understood by the client.
• Random: A client-generated random structure consisting of a 32-bit timestamp and 28 bytes
generated by a secure random number generator. These values serve as nounces.
• Session ID: A variable-length session identifier.
• CipherSuite: This is a list that contains the combinations of cryptographic algorithms
supported by the client, in decreasing order of preference.
• Compression Method: This is a list of the compression methods the client supports.
Phase 2 The server begins this phase by sending its certificate if it needs to be authenticated; the message
Server contains one or a chain of X.509 certificates. The certificate message is required for any agreed-on
Authentication key exchange method except anonymous Diffie-Hellman. Note : if fixed Diffie-Hellman is used, this
and Key
certificate message functions as the server’s key exchange message because it contains the server’s
public Diffie-Hellman parameters.
Exchange
Next, a server_key_exchange message may be sent if it is required. It is not required in two
instances: (1) The server has sent a certificate with fixed Diffie-Hellman parameters
(2) a RSA key exchange is to be used.
Phase 3 Upon receipt of the server_done message, the client should verify that the server provided a
Client valid certificate and check that the server_hello parameters are acceptable. If all is
Authentication satisfactory, the client sends one or more messages back to the server.
and Key If the server has requested a certificate, the client begins this phase by sending a certificate
Exchange message.
Next is the client_key_exchange message, which must be sent in this phase.
Phase 4 The client sends a change_cipher_spec message and copies the pending CipherSpec into
This phase the current CipherSpec.
completes The client then immediately sends the finished message under the new algorithms, keys, and
the setting secrets. The finished message verifies that the key exchange and authentication processes were
up of a successful. The content of the finished message is the concatenation of two hash values:
secure
connection
where Sender is a code that identifies that the sender is the client and handshake_messages
is all of the data from all handshake messages up to but not including this message.
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. At this point, the
handshake is complete and the client and server may begin to exchange application-layer data
• The use of the Heartbeat protocol is established during Phase 1 of the Handshake protocol
• The requirement for the exchange of a payload was designed into the Heartbeat protocol to
support its use in a connectionless version of TLS known as Datagram Transport Layer Security
(DTLS)
SSL/TLS attacks
• Other attacks
HTTPS : Refers to the combination of HTTP and SSL to implement secure communication between a
Web browser and a Web server • The HTTPS capability is built into all modern Web browsers
HTTP clients also must be able to cope with a situation in which the underlying TCP connection is terminated
without a prior close_notify alert and without a Connection: close indicator. Such a situation could
be due to a programming error on the server or a communication error that causes the TCP connection to drop.
However, the unannounced TCP closure could be evidence of some sort of attack. So the HTTPS client should
issue some sort of security warning when this occurs.
Unit-V
Digital signatures:
1. Mary may forge a different message and claim that it came from John. Mary would simply have to create a
message and append an authentication code using the key that John and Mary share.
2. John can deny sending the message. Because it is possible for Mary to forge a message, there is no way to prove
that John did in fact send the message
First scenario example: An electronic funds transfer takes place, and the receiver increases the amount of funds
transferred and claims that the larger amount had arrived from the sender.
Second scenario example: Email contains instructions to a stockbroker for a transaction that subsequently turns
out badly. The sender pretends that the message was never sent.
If the signature is the inner operation, then the recipient can store the plaintext message and its signature
for later use in dispute resolution.
??? The sender can claim that the private key was lost or stolen and that someone else forged his or her
signature.
Therefore we require every signed message to include a timestamp (date and time) and to require prompt
reporting of compromised keys to a central authority.
In the RSA approach, the message to be signed is input to a hash function that produces a secure hash code of
fixed length. This hash code is then encrypted using the sender’s private key to form the signature. Both the
message and the signature are then transmitted. The recipient takes the message and produces a hash code. The
recipient also decrypts the signature using the sender’s public key. If the calculated hash code matches the
decrypted signature, the signature is accepted as valid. Because only the sender knows the private key, only the
sender could have produced a valid signature.
In DSA approach here note the difference??--> The hash code is provided as input to a signature function along
with a random number k generated and a global public key (PUG).
Therefore these two extra details receiver should know i.e k and (PUG).
lt is a signature consisting of two components, labeled s and r.
r part is message independent.
At the receiving end, the hash code of the incoming message is generated. This plus the signature is input to a
verification function. The verification function also depends on the global public key as well as the sender’s public
key (PUa), which is paired with the sender’s private key. The output of the verification function is a value that is
equal to the signature component r if the signature is valid. The signature function is such that only the sender,
with knowledge of the private key, could have produced the valid signature.
The receiver generates a quantity v that is a function of the public key components, the sender’s public key, and
the hash code of the incoming message (verifying process). If this quantity matches the r component of the
signature, then the signature is validated.
Note that the test at the end is on the value r, which does not depend on the message at all. Instead, r is a function
of k and the three global public-key components. The multiplicative inverse of k (mod q) is passed to a function
that also has as inputs the message hash code and the user’s private key. The structure of this function is such that
the receiver can recover r using the incoming message and signature, the public key of the user, and the global
public key.
1> Given the difficulty of taking discrete logarithms, it is infeasible for an opponent to recover k from r or
to recover x from s.
2> only computationally demanding task in signature generation is the exponential calculation gk mod p.
Because this value does not depend on the message to be signed, it can be computed ahead of time.
3> Indeed, a user could pre-calculate a number of values of r to be used to sign documents as needed. The
only other somewhat demanding task is the determination of a multiplicative inverse, k-1. Again, a
number of these values can be pre-calculated.
IP Security:
Applications of IPsec
• Secure branch office connectivity over the Internet: A company can build a secure virtual private network
over the Internet or over a public WAN. This enables a business to rely heavily on the Internet and reduce its need
for private networks, saving costs and network management overhead.
• Secure remote access over the Internet: An end user whose system is equipped with IP security protocols can
make a local call to an Internet Service Provider (ISP) and gain secure access to a company network. This reduces
the cost of toll charges for traveling employees and telecommuters.
• Establishing extranet and intranet connectivity with partners: IPsec can be used to secure communication
with other organizations, ensuring authentication and confidentiality and providing a key exchange mechanism.
• Enhancing electronic commerce security: Even though some Web and electronic commerce applications have
built-in security protocols, the use of IPsec enhances that security.
Benefits of IPsec
• When IPsec is implemented in a firewall or router, it provides strong security.
• IPsec in a firewall is resistant to bypass if all traffic from the outside must use IP.
• IPsec is below the transport layer (TCP, UDP) and so is transparent to applications.
There is no need to change software on a user or server system when IPsec is implemented in the firewall or
router.
• IPsec can be transparent to end users.
• IPsec can provide security for individual users if needed. This is useful for offsite workers and for setting up a
secure virtual subnetwork within an organization for sensitive applications.
Routing applications of IPsec
• A 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 documents
• Architecture: Covers the general concepts, security requirements, definitions, and mechanisms defining IPsec
technology. The current specification is RFC 4301, Security Architecture for the Internet Protocol.
• Authentication Header (AH): AH is an extension header to provide message authentication. The current
specification is RFC 4302, IP Authentication Header.
• Encapsulating Security Payload (ESP): ESP consists of an encapsulating header and trailer used to provide
encryption or combined encryption/authentication. The current specification is RFC 4303, IP Encapsulating
Security Payload (ESP).
• Internet Key Exchange (IKE): This is a collection of documents describing the key management schemes for
use with IPsec. The main specification is RFC 5996.
IPsec 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 policy
Fundamental to the operation of IPsec is the concept of a security policy applied to each IP packet that transits
from a source to a destination.
IPsec policy is determined primarily by the interaction of two databases, the security association database
(SAD) and the security policy database (SPD). This section provides an overview of these two databases and
then summarizes their use during IPsec operation.
Outbound processing obeys the following general sequence for each IP packet.
1. Compare the values of the appropriate fields in the packet (the selector fields) against the SPD to find a matching
SPD entry, which will point to zero or more SAs.
2. Determine the SA if any for this packet and its associated SPI.
3. Do the required IPsec processing (ESP processing).
IP Traffic processing
IPsec is executed on a packet-by-packet basis. When IPsec is implemented, each outbound IP packet is processed
by the IPsec logic before transmission, and each inbound packet is processed by the IPsec logic after reception
and before passing the packet contents on to the next higher layer (e.g., TCP or UDP).
Outbound Packets . A block of data from a higher layer, such as TCP, is passed down to the IP layer and an
IP packet is formed, consisting of an IP header and an IP body. Then the following steps occur:
1. IPsec searches the SPD for a match to this packet.
2. If no match is found, then the packet is discarded and an error message is generated.
3. If a match is found, further processing is determined by the first matching entry in the SPD. If the policy for
this packet is DISCARD, then the packet is discarded. If the policy is BYPASS, then there is no further IPsec
processing; the packet is forwarded to the network for transmission.
4. If the policy is PROTECT, then a search is made of the SAD for a matching entry. If no entry is found, then
IKE is invoked to create an SA with the appropriate keys and an entry is made in the SA.
5. The matching entry in the SAD determines the processing for this packet. Either encryption, authentication,
or both can be performed, and either transport or tunnel mode can be used. The packet is then forwarded to the
network for transmission.
Two additional fields may be present in the payload. An initialization value (IV), or nonce, is present if this is
required by the encryption or authenticated encryption algorithm used for ESP. If tunnel mode is being used,
then the IPsec implementation may add traffic flow confidentiality (TFC) padding after the Payload Data
Encryption and Aunthentication Algorithms
The Payload Data, Padding, Pad Length, and Next Header fields are encrypted by the ESP service. If the algorithm
used to encrypt the payload requires cryptographic synchronization data, such as an initialization vector (IV), then
these data may be carried explicitly at the beginning of the Payload Data field.
The ICV is computed after the encryption is performed. This order of processing facilitates rapid detection and
rejection of replayed or bogus packets by the receiver prior to decrypting the packet, hence potentially reducing
the impact of denial of service (DoS) attacks. It also allows for the possibility of parallel processing of packets at
the receiver that is decryption can take place in parallel with integrity checking.