entropy
A measure of how unpredictable a value is; high-entropy secrets are long and truly random so they cannot be guessed.
In more detail
High-entropy values come from a cryptographically secure random generator, not from timestamps or Math.random. Tokens, session identifiers and keys all need high entropy.
Example
PKCE code verifiers, session IDs and CSRF tokens use crypto.getRandomValues.Related terms
- PKCE — Short for Proof Key for Code Exchange: the client sends a hash of a random secret at the start of the flow and the secret itself when exchanging the code.
- session — A record the server keeps about a logged-in caller, found on each request through a handle the client presents, usually in a cookie.
- secret — Any value that grants access, such as a password, access token or private key, and must be kept out of code and version control.
- secret scanning — Searching code, commits and files for credentials such as keys and tokens, ideally before they are committed.
Taught in
- OAuth2 & OpenID Connect: Social Auth & PKCE Flows — Production Full-Stack Engineering
- Secret Scanning — Application Security & Threat Modeling for Engineers