How TLS works / TLS Handshake Protocol

Transport Layer Security (TLS) and it's predecessor, Secure Sockets Layer (SSL), are cryptographic protocols that provide communication security over the Internet. They use asymmetric cryptography for authentication of key exchange, symmetric encryption for confidentiality and message authentication codes for message integrity.

Once the client and server have decided to use TLS, they negotiate a stateful connection by using a handshaking procedure. During this handshake, the client and server agree on various parameters used to establish the connection's security. The TLS Handshake Protocol involves the following steps:

  1. The client sends a "Client hello" message to the server, along with the client's random value and supported cipher suites.


  2. The server responds by sending a "Server hello" message to the client, along with the server's random value.

  3. The server sends its certificate to the client for authentication and may request a certificate from the client. The server sends the "Server hello done" message.
  4. If the server has requested a certificate from the client, the client sends it.
  5. The client creates a random Pre-Master Secret and encrypts it with the public key from the server's certificate, sending the encrypted Pre-Master Secret to the server.
  6. The server receives the Pre-Master Secret. The server and client each generate the Master Secret and session keys based on the Pre-Master Secret.
  7. The client sends "Change cipher spec" notification to server to indicate that the client will start using the new session keys for hashing and encrypting messages. Client also sends "Client finished" message.
  8. Server receives "Change cipher spec" and switches its record layer security state to symmetric encryption using the session keys. Server sends "Server finished" message to the client.


  9. Client and server can now exchange application data over the secured channel they have established. All messages sent from client to server and from server to client are encrypted using session key.







Related links:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa380513(v=vs.85).aspx
http://technet.microsoft.com/en-us/library/cc781476(v=ws.10).aspx

Comments

Popular posts from this blog

Filtering Routes in BGP using Route-maps and Prefix-list

Ansible-playbook for backing up running config of Cisco IOS

Ansible-Playbook to display output of multiple show commands (using stdout_lines with Loop)

Export or Backup Azure Virtual Networks or Subnet information into CSV using PowerShell

Ansible Playbook for Network OS Upgrade with pre and post checks

Export or Backup Azure Route Table into CSV using PowerShell

Cisco ASA Active/Active Failover Configuration

VMware NSX Traffic Flow — East-West & North-South

Get Model Number and Serial number of Cisco devices using ios_facts module

Download Visio Stencils for Network Topology