UNIT-V(SSL)
UNIT-V(SSL)
UNIT-V(SSL)
Client key exchange: It allows the client to send information to the server, but in the opposite
direction. This information is related to the symmetric key that both the parties will use in this
session. Here, the client creates a 48-byte pre-master secret, and encrypts it with the server’s
public key and sends this encrypted pre-master secret to the server.
Certificate verify: It is necessary only if the server had demanded client authentication.
As we know, if this is the case, the client has already sent its certificate to the server.
However, additionally, the client also needs to prove to the server that it is the correct and
authorized holder of the private key corresponding to the certificate. For this purpose, in this
optional step, the client combines the pre-master secret with the random numbers exchanged
by the client and the server earlier after hashing them together using MD5 and SHA-1, and
signs the result with its private key.
The client initiates this fourth phase of the SSL handshake, which the
server end.
The first two messages are from the client:
Change cipher specs, Finished.
The server responds back with two identical messages:
Change cipher specs, Finished.
• Based on the pre-master secret that was created and sent by the client in the Client key
exchange message, both the client and the server create a master secret.
• Before secure encryption or integrity verification can be performed on records, the client
and server need to generate shared secret information known only to them. This value is a
48-byte quantity called the master secret.
• The master secret is used to generate keys and secrets for encryption and MAC
computations. The master secret is calculated after computing message digests of the pre-
master secret, client random and server random,
After this, the first step (Change cipher specs) is a confirmation from the client
that all is well from its end, which it strengthens with the Finished message. The
server sends identical messages to the client.
The Record Protocol in SSL comes into picture after a successful handshake is
completed between the client and the server.
That is, after the client and the server have optionally authenticated each other
and have decided what algorithms to use for secure information exchange, we enter
into the SSL record protocol.
This protocol provides two services to an SSL connection, as follows:
(a) Confidentiality This is achieved by using the secret key that is defined by the
handshake protocol.
(b) Integrity The handshake protocol also defines a shared secret key (MAC) that is
used for assuring the message integrity
Fragmentation :The original application message is broken into blocks, so
that the size of each block is less than or equal to 2^14 bytes (16,384
bytes).
Compression :The fragmented blocks are optionally compressed. The
compression process must not result into the loss of the original data,
which means that this must be a lossless compression mechanism.
Addition of MAC :Using the shared secret key established previously in
the handshake protocol, the Message Authentication Code (MAC) for each
block is calculated. This operation is similar to the HMAC algorithm.
Encryption: Using the symmetric key established previously in the
handshake protocol, the output of the previous step is now encrypted. This
encryption may not increase the overall size of the block by more than
1024 bytes.
Append Header Finally, a header is added to the encrypted block. The header
contains the following fields:
1.Content type (8 bits) :Specifies the protocol used for processing the
record in the next higher level (e.g. handshake, alert, change cipher).
4.Compressed length (16 bits) Specifies the length in bytes of the original
plain-text block (or the compressed block, if compression is used).
When either the client or the server detects an error, the detecting party
sends an alert message to the other party.
If the error is fatal, both the parties immediately close the SSL connection .
Both the parties also destroy the session identifiers, secrets and keys
associated with this connection before it is terminated.
Other errors, which are not so severe, do not result in the termination of the
connection. Instead, the parties handle the error and continue.
• Each alert message consists of two bytes. The first byte signifies the
type of error. If it is a warning, this byte contains 1.
• If the error is fatal, this byte contains 2. The second byte specifies
the actual error.
Before ending their communication, the client and the server must inform each
other that their side of the connection is ending.
When a party receives this alert, it must immediately stop whatever it is doing,
send its own Close notify alert and end the connection from its side as well.
If an SSL connection ends without a Close notify from either party, it cannot be
resumed.
The handshake protocol in SSL is quite complex and time consuming, as it
uses asymmetric-key cryptography. Therefore, if desired, a client and a server
can decide to reuse or resume an earlier SSL connection, rather than creating a
fresh one with a new handshake.
However, for this to be possible, both the parties must agree on the reuse. If
either party feels that it is dangerous to reuse the earlier connection, or if the
other party’s certificate has expired since the last connection, it can force the
other party to perform a fresh handshake.
As per the SSL specifications, any SSL connection should not be reused
after 24 hours in any case.
Transport Layer Security (TLS) is an IETF standardization
initiative, whose goal is to come out with an Internet standard
version of SSL.
Netscape wanted to standardize SSL, and hence handed the
protocol over to IETF. There are subtle differences between
SSL and TLS.
However, the core idea and implementation are quite similar.
TLS is defined in RFC 2246.