Web Security II: Secure Communication with HTTPS

Robert D. Cameron
February 4, 2004

I. Security Goals

HTTP is an open protocol, inappropriate for secure communications.

HTTPS is designed to support secure, private communications.

II. Encryption

Encryption is the process of translating a plaintext message into an encoded form, not readable by others.

A ciphertext is the result of encryption. The ciphertext can be transmitted over the network. Even if intercepted, the ciphertext is designed to be unreadable.

Decryption is the process of recovering the original plaintext message from the ciphertext.

Public Algorithms, Private Keys

Encryption generally uses public algorithms and private keys. Public algorithms are assumed to be known by everyone. Private keys are the secrets that allow senders and recipients to keep others from decrypting messages.

Why public algorithms? Secrecy can be achieved using private algorithms known only to sender and recipient. But what if the algorithm is discovered?

Symmetric vs. Public Key Algorithms

Symmetric algorithms use the same key for encryption and decryption.

Public key algorithms use two keys: a public encryption key and a private decryption key.

Limits to Encryption

Encryption technology cannot provide a guarantee of confidentiality. The plaintext of a message may be discovered in several ways.

III. Authentication

Digital Signatures

A digital signature is used to secure the authenticity of a document.

But how do we know that we have the right public key for an author, i.e., it is not a fake?

Digital Certificates

A digital certificate is a record that establishes the identity of a party to a communication (e.g., author of a document).

IV. SSL/TSL: Secure Sockets Layer/Transport Layer Security

SSL (Secure Sockets Layer) 3.0 is the current widely deployed protocol used for providing a secure communications layer for HTTP, as developed by Netscape.

TLS (Transport Layer Security) is the standards-track IETF protocol based on SSL. TLS 1.0 is essentially the successor to SSL 3.0.

SSL/TLS is a layer on top of TCP/IP, below application level protocols.

HTTP over SSL/TLS is known as HTTPS.

Application Layer HTTP HTTPS
Network Layer TCP/IP SSL/TLS
TCP/IP

Normally, HTTPS service listen on port 443, while HTTP defaults to port 80. Both types of service may be running on a single server.

The Handshake

The handshake is the key process for a client and server to exchange authentication and encryption information under SSL or TLS.

  1. Establish identity of server.
  2. Develop a shared encryption key that can be used to exchange messages, called the session key.

Essentially, SSL consists of two phases corresponding to two subprotocols. The SSL Handshake Protocol governs the first phase to establish secure communication. Subsequently, all messages are encrypted and exchanged using the SSL Record Protocol.