\( \def\ZZ{\mathbb{Z}} \def\GG{\mathbb{G}} \def\HH{\mathbb{H}} \)

Overview

TLS is the mostly widely used cryptographic protocol for secure communications on the Internet.

The main benefits of TLS is as follows:

TLS Layer

The TLS security protocol is layered between the application protocol layer and TCP/IP layer, where it can secure and then send application data to the transport layer. Because it works between the application layer and the TCP/IP layer, TLS can support multiple application layer protocols.

The TLS protocol can be divided into two sub-layers.
  • Handshake layer.

    The Handshake Layer again consists of three sub-protocols:

    • Handshake. This sub-protocol is used to establish a session key between the client and the server.
    • Change Cipher Spec. The Change Cipher Spec sub-protocol is used when the sender wants to change to a new set of keys. The key is computed from the information exchanged by the Handshake sub-protocol.
    • Alert. Alert messages are used to indicate a change in status or an error condition to the peer. Alerts are commonly sent when the connection is closed, an invalid message is received, a message cannot be decrypted, or the user cancels the operation.

Fig 1. TLS Protocol Layers

TLS Protocol

TLS protocol consists of two steps.

Fig 2. Two steps of TLS

Handshake Protocol

When a client connects a server, both parties need to establish a shared private key (session key) under which data are to be encrypted. Moreover, the server show its certificate to authenticate itself to the client. The detailed procedure is as follows:

1. First Client Message to Sever

2. Server Response to Client

3. Client Response to Server

4. Server Final Response to Client

Record Protocol

The record protocol receives the data from the application layer. In particular,

Fig 4. Record protocol

Example: Capture Packets

FREAK Attack (2015)

FREAK ("Factoring RSA Export Keys") is a security exploit of a cryptographic weakness in the TLS protocols introduced decades earlier for compliance with U.S. cryptography export regulations. These involved limiting exportable software to use only public key pairs with RSA moduli of 512 bits or less (so-called RSA_EXPORT keys), with the intention of allowing them to be broken easily by the NSA, but not by other organizations with lesser computing resources. However, by 2015, increases in computing power meant that they could be broken by anyone with access to relatively modest computing resources, using as little as $100 of cloud computing services.

Combined with the ability of a man-in-the-middle to manipulate the initial cipher suite negotiation between the endpoints in the connection, this meant that the adeversary, with only a modest amount of computation, could break the security of any website that allowed the use of 512-bit export-grade keys. In particular:

  1. Your browser starts to connect to an HTTPS website, asking to use a strong cipher.
  2. The attacker intercepts this request and replaces it with one asking to use weak "export-grade" encryption.
  3. The server gets this modified request and responds to your browser with an export-grade encryption key.
  4. Your browser doesn't notice the key it got is weaker than the one it asked for, and finishes setting up the SSL session using this weak key.
  5. The attacker can now record your session and break the encryption on it in a matter of minutes to hours, or if the server re-uses keys (most of them do), use a previous break to read (and potentially modify) your traffic as it goes by.

Other attacks

Similar ideas are applied to subsequent attacks.