
# Encrypt and decrypt

> Encrypt claims or data so only the holder of the right key can read them, and any change makes the token fail to open.

An encrypted token (a JWE) is a locked box. Each token gets a fresh random key that locks the content, and that key is itself locked for the recipient: with a key you share, with the recipient's public key, or with a key derived from a password. The recipient unlocks the small key, then the box, and the box's seal breaks if anyone changed a byte on the way. Unlike a [signed token](/jws), nobody on the path can read the content. What a JWE made with a public key doesn't tell you is who sent it, since anyone holding that public key can lock a box; [sign, then encrypt](/jwe/encrypt#sign-then-encrypt) when the sender matters. [Concepts](/getting-started/concepts) has the vocabulary.

::card-group
::card{title="Encrypt a payload" icon="i-lucide-lock-keyhole" to="/jwe/encrypt"}
Turn claims, text or bytes and a key or password into a compact token.
::
::card{title="Decrypt a token" icon="i-lucide-lock-open" to="/jwe/decrypt"}
Open the token with a key, a JWK Set or a password, and check its claims.
::
::card{title="Encrypt for several recipients" icon="i-lucide-users" to="/jwe/multi"}
Encrypt once and let several recipients open it, each with its own key.
::
::card{title="Choose encryption algorithms" icon="i-lucide-list-checks" to="/jwe/algorithms"}
Which `alg` delivers the key and which `enc` locks the content.
::
::
