TLS security is designed to use encryption from both client and server ends to help ensure a secure connection between two or more communicating applications, guarantee interoperability between devices, and operate with relative efficiency.
Client-server communication begins by indicating whether communications will proceed with or without TLS protocols. The client can specify a TLS connection in a variety of ways. For instance, the client might use a port number that supports the types of encryptions used in TLS communications. Another potential method is to make a protocol-specific request to switch to a TLS connection.
Once the client and server have agreed to communicate using TLS, the TLS protocol specification proceeds through two layers: the TLS handshake protocol and the TLS record protocol. TLS protocols use a combination of symmetric and asymmetric cryptography. Symmetric cryptography creates keys known to both the sender and recipient, while asymmetric cryptography generates key pairs—one public (shared between both the sender and recipient) and one private.
The specifications required to exchange an application “message” are established in the TLS handshake protocol. A TLS handshake involves a series of exchanges between client and server that vary based on the utilized key exchange algorithm and the supported cipher suites, but can unfold as follows:
- A client sends a “client hello” message requesting a connection and presents a list of supported cipher suites (a set of encryption algorithms used to establish a secure connection) and a random string of bytes (known as the “client random”).
- The server responds with a “server hello” message containing the chosen TLS protocol version (1.0, 1.2, etc.), the chosen cipher suite, and a random string of bytes (known as the “server random”).
- The server sends its SSL certificate to the client for authentication. The client authenticates the server by verifying the SSL certificate, and can also send a certificate for authentication if requested by the server.
- The client sends a second string of random bytes, the “premaster secret.” The client uses asymmetric cryptography to generate a public key from the server’s security certificate, which is then used to encrypt the premaster secret. The premaster secret can only be decrypted with the private key by the server.
- The server decrypts the premaster secret with the private key.
- Both client and server generate session keys from the client random, the server random, and the premaster secret.
- The client sends a “finished” message that has been encrypted with a session key.
- The server responds with a “finished” message that has been encrypted with a session key.
- The client and server have successfully achieved secure symmetric encryption, meaning the handshake is complete and communication can continue with the established session keys.
Once the decryption method is established during the handshake procedure, TLS record protocol uses symmetric cryptography to generate unique session keys for each connection that enables continued communication throughout the session. The record protocol also appends any data getting sent out with a hash-based message authentication code (HMAC).
Because encryption protocols in TLS are complex, users should expect to expend some computation power on the process. But TLS also has internal techniques in place to prevent significant lags. As a result, TLS protocols shouldn’t noticeably affect web application performance and load times, nor should it increase computational costs for most organizations.
The Difference Between TLS, SSL, and HTTPS
TLS originally evolved from Secure Socket Layers (SSL). SSL was developed in 1994 to facilitate secure web sessions. It underwent several upgrades before the introduction of TLS. TLS 1.0 was first published in January 1999 as an upgrade of SSL version 3.0. TLS 1.3, the current version of TLS, was published in 2018.
Both TLS and SSL are widely used in web browsers, email, messaging apps, and other applications—although TLS has generally displaced SSL in newer systems. Generally, TLS offers stronger encryption algorithms for authentication and supports pre-shared keys and secure remote passwords.
Although the differences between SSL and TLS are minor, some aspects of their protocols clearly distinguish TLS from SSL. The two protocols are not interoperable, although TLS protocols offer some compatibility with older devices using SSL. TLS has a different handshake process from SSL, supports a greater array of cipher suites, and uses HMAC rather than the more general MAC in its record protocol.
Hypertext transfer protocol secure (HTTPS) refers to the implementation of TLS on top of HTTP protocol. Consumers typically know HTTPS as the secure version of HTTP—the primary protocol used to send data between websites.
The Purpose of TLS
TLS encryption helps protect web applications against data tampering and eavesdropping and is becoming standard practice for most websites. SSL/TLS protocols were developed to respond to the increasing number of security threats and the need for encryption from both client and server ends.
TLS is in place to help protect user privacy and security. Without TLS, sensitive information transferred over the internet such as login credentials, personal information, and credit card numbers are vulnerable to theft. It would also be possible for unknown third parties to monitor emails, browsing habits, and direct message correspondence.
In addition to protecting individual user information, TLS also helps protect web applications against data breaches and distributed denial-of-service (DDoS) attacks. Data breaches and DDoS attacks can prove to be incredibly costly to organizations of all sizes and can also cause irreparable damage to consumer trust. Ensuring that web browsers are using TLS is an easy way to amplify security and help protect both user and organizational privacy.
Most browsers today support TLS by default. For instance, Google Chrome actively warns users against non-HTTPS websites. In turn, users are also becoming savvier about website security and checking for secure data transfer protocols. By insisting on mandatory use of TLS in all web-based communications, organizations and individuals can help ensure a shared basic level of protection for web-based activity.
This is not to say that TLS is impossible to breach—breaches to TLS protocols in the last decade include BEAST in 2011, CRIME in 2012, BREACH in 2013, and Heartbleed in 2014. But since then, TLS protocols have made major revisions designed to eliminate flawed code and have added improvements in areas of security, performance, and privacy. The newest version of TLS (1.3) speeds up the encryption process, which in turn accelerates the handshake process. It also eliminates older algorithms that created vulnerabilities in previous versions.
For more information on TLS and the benefits of this security layer read through our related blog articles.