Understand TLS in 5 mins

Divesh
4 min readFeb 11, 2023

--

Just don’t see the color

TLS stands for “Transport Layer Security,” which is a protocol used to provide secure communication over the internet. It is commonly used to secure web traffic, email, instant messaging, and other types of network communication. TLS works by encrypting the data exchanged between two systems and verifying the identity of the systems using digital certificates. TLS has replaced its predecessor, Secure Sockets Layer (SSL), as the standard protocol for secure communication on the internet.

Why TLS invented?

TLS (Transport Layer Security) was invented to provide a secure and private way to transmit data over the internet. Before TLS, there was the SSL (Secure Sockets Layer) protocol, which was the first widely-used encryption protocol for secure communication over the internet. However, SSL had some vulnerabilities and weaknesses that were later addressed in the development of TLS.

TLS was invented to address the following security concerns that SSL did not fully address:

  1. Strength of encryption: TLS offers stronger encryption than SSL, making it more difficult for attackers to decrypt intercepted data.
  2. Authentication: TLS provides a more robust system for authenticating users and servers, reducing the risk of man-in-the-middle attacks.
  3. Key exchange: TLS includes mechanisms for secure key exchange, ensuring that the keys used for encryption are not compromised.

Overall, TLS was invented to improve upon SSL’s security features and provide a more secure and private way to transmit data over the internet. TLS is now the standard protocol for secure communication over the internet and is used to protect a wide range of online transactions, including online banking, e-commerce, and other sensitive data transfers.

Lets understand its usage:

See, TLS is used to provide secure communication over the internet, particularly in situations where sensitive or confidential data is being transmitted.

Some common examples of TLS usage include:

  1. Secure web browsing: When you visit a website that uses HTTPS (HTTP Secure), your web browser and the website’s server establish a TLS connection to encrypt the data being exchanged.
  2. Email encryption: TLS can be used to encrypt email messages between mail servers to protect the contents of the message from interception.
  3. Virtual Private Networks (VPNs): Many VPNs use TLS to secure the communication between the VPN client and server.
  4. Instant messaging: Some instant messaging services use TLS to encrypt the messages being exchanged between users.

Overall, TLS is a crucial technology that helps to protect the privacy and security of data transmitted over the internet.

Now Lets understand TLS handshake:

The TLS handshake is the process that occurs at the beginning of a TLS session, in which the client and server establish a secure connection. The TLS handshake involves the following steps:

  1. ClientHello: The client sends a message to the server, indicating which TLS version it supports and a list of supported cipher suites.
  2. ServerHello: The server responds with a message, selecting the TLS version and cipher suite to use for the session.
  3. Certificate: The server sends its digital certificate to the client, which contains the server’s public key.
  4. ClientKeyExchange: The client sends a message to the server, encrypting a pre-master secret with the server’s public key.
  5. ServerKeyExchange (optional): If the server requires the client to authenticate itself, it sends a message requesting client authentication.
  6. CertificateRequest (optional): If the server requires the client to authenticate itself, it sends a message requesting client authentication.
  7. CertificateVerify (optional): The client sends a digitally signed message to the server, using its private key to prove its identity.
  8. Finished: Both the client and server send a message to each other, containing a hash of all previous handshake messages, to confirm that the handshake was successful.

Once the TLS handshake is complete, the client and server use the shared secret generated from the pre-master secret to encrypt and decrypt data being transmitted during the session.

Lets now understand the most common question asked by every interviewer for tech people who are seeking jobs in sysadmin, devops.

What is the difference between TLS and SSL?

So to answer this question simply understand few lines and explain it.

TLS (Transport Layer Security) and SSL (Secure Sockets Layer) are both protocols used for secure communication over the internet. SSL was the predecessor to TLS, and TLS was developed to address some of the security vulnerabilities and weaknesses of SSL. The main differences between TLS and SSL are:

  1. Strength of encryption: TLS offers stronger encryption than SSL, with more robust algorithms and longer key lengths.
  2. Authentication: TLS provides a more robust system for authenticating users and servers, reducing the risk of man-in-the-middle attacks.
  3. Key exchange: TLS includes mechanisms for secure key exchange, ensuring that the keys used for encryption are not compromised.
  4. Protocol version: TLS has been updated several times since its inception, with the latest version being TLS 1.3. SSL, on the other hand, has not been updated since SSL 3.0, which is now considered insecure.
  5. Naming convention: SSL and TLS use different naming conventions for their protocols. For example, SSL 3.0 is sometimes referred to as TLS 1.0, which can be confusing.

Overall, TLS is considered to be more secure than SSL and is the recommended protocol for secure communication over the internet. SSL is now considered outdated and insecure, and its use is discouraged.

--

--

Divesh
Divesh

Written by Divesh

An Architect, A DevOps Engineer, An Automation master, A Kubernetes Security Specialist and always willing to help because helping others is my favourite task.

No responses yet