HSTS
HTTP Strict Transport Security
An HTTP header instructing browsers to only connect via HTTPS, preventing protocol downgrade attacks.
Technical Detail
HSTS performs a handshake establishing an encrypted channel. TLS 1.3 (2018) reduced the handshake from 2 round-trips to 1, improving latency by ~100ms. It eliminated vulnerable algorithms: no RSA key exchange, no CBC mode, no SHA-1. Only five cipher suites remain, all using AEAD (Authenticated Encryption with Associated Data). Certificate verification uses a chain of trust: site certificate → intermediate CA → root CA (pre-installed in browsers/OS). Let's Encrypt automates certificate issuance for free using the ACME protocol.
Example
```javascript
// HSTS — Web Crypto API example
const data = new TextEncoder().encode('sensitive data');
const hash = await crypto.subtle.digest('SHA-256', data);
const hex = Array.from(new Uint8Array(hash))
.map(b => b.toString(16).padStart(2, '0')).join('');
```