# What Is PSK (Pre-Shared Key)? Definition and Examples

> PSK (pre-shared key) in TLS is a secret both peers already hold before the handshake, used for session resumption or to authenticate without certificates.

Source: https://ssl.sh/glossary/psk/
Last updated: 2026-11-10

A pre-shared key comes from one of two places. External PSKs are provisioned out of band, typically for IoT or other constrained devices that cannot handle certificates; TLS 1.2 has dedicated suites for them such as TLS_PSK_WITH_AES_128_GCM_SHA256. Resumption PSKs are derived from an earlier connection: in [TLS 1.3](https://ssl.sh/glossary/tls-1-3/) the server sends a NewSessionTicket, and the ticket becomes the identity of a PSK the client can offer next time. TLS 1.3 uses one mechanism for both, the pre_shared_key extension, in which a binder value proves the client actually knows the key.

## Why it matters
Resuming with a PSK skips certificate transmission, chain validation and signatures, so it is faster, and it is the basis of [0-RTT](https://ssl.sh/glossary/0-rtt/) early data. The psk_key_exchange_modes extension decides the security trade-off: psk_ke uses the PSK alone and has no [forward secrecy](https://ssl.sh/glossary/forward-secrecy/), while psk_dhe_ke adds a fresh (EC)DHE exchange; web browsers normally offer psk_dhe_ke.

## Example
Fields in a TLS 1.3 resumption ClientHello, and a quick resumption test with OpenSSL:

```text
psk_key_exchange_modes: psk_dhe_ke
key_share:              x25519 (...)
early_data              (only when sending 0-RTT data)
pre_shared_key:         identity = <ticket>, binder = <HMAC over the ClientHello>
```

```bash
openssl s_client -connect example.com:443 -sess_out session.pem
openssl s_client -connect example.com:443 -sess_in session.pem
```

The second run reports `Reused` when the server accepts the PSK.

## Common misconceptions
- **"PSK connections have no forward secrecy."** Only the psk_ke mode lacks it; psk_dhe_ke combines the PSK with an ephemeral key exchange.
- **"A PSK is just a password."** External PSKs must be high-entropy random keys; low-entropy secrets can be guessed offline from a recorded handshake.
- **"Session tickets and PSKs are separate mechanisms in TLS 1.3."** A TLS 1.3 session ticket is simply the identity of a resumption PSK.

## Related terms

- [会话恢复](https://ssl.sh/zh/glossary/session-resumption/): 会话恢复是 TLS 的一种机制，客户端重连时复用先前会话的密钥材料，跳过完整的密钥交换和证书验证。
- [Session Ticket](https://ssl.sh/zh/glossary/session-ticket/): Session Ticket 是服务器交给客户端保管的加密会话状态，客户端下次连接时出示它即可恢复会话，服务器无需保存任何状态。
- [0-RTT](https://ssl.sh/zh/glossary/0-rtt/): 0-RTT 是 TLS 1.3 和 QUIC 的特性，允许回访的客户端用上一次会话留下的密钥，在第一个数据包里就发送应用数据。
- [TLS 1.3](https://ssl.sh/zh/glossary/tls-1-3/): TLS 1.3 是当前最新的传输层安全协议版本（2018 年的 RFC 8446，现行规范为 RFC 9846），完整握手只需一个往返，且只保留 AEAD 加密算法。
- [前向保密](https://ssl.sh/zh/glossary/forward-secrecy/): 前向保密是密钥交换的一种安全属性：即使服务器的长期私钥日后泄露，过去连接的会话密钥也不会因此暴露。
- [密钥交换](https://ssl.sh/zh/glossary/key-exchange/): 密钥交换是 TLS 握手中客户端与服务器建立共享秘密的步骤，保护连接的对称密钥都由这个共享秘密派生而来。
