Your files stay on your device

JWE compact decrypt

Decrypt compact JWE tokens with local symmetric, password or RSA private keys.

Encrypted token (JWE)

Loading editor…
Five parts separated by dots

Shared secret

Loading editor…
A JWK or a base64url secret

Five parts, not three

A signed JWT has three dot-separated parts. A compact JWE has five: the protected header, the wrapped CEK, the initialization vector, the ciphertext, and the authentication tag. The CEK is the random value that encrypts the payload. The second part is empty when the header uses alg dir, because the shared secret is used directly as the CEK.

alg wraps, enc encrypts

Read the two header fields as separate jobs. alg answers how the sender protected the CEK, and enc names the cipher that encrypted the payload. Either one can be wrong for your setup, so check both.

alghow the CEK is protected, such as dir, A128KW, or RSA-OAEP
encthe cipher for the payload, such as A128GCM or A256GCM

Matching the input to the mode

  • A password works only with the PBES2 family of alg values.
  • An RSA private half must be PKCS#8 PEM, so a PKCS#1 block will not import.
  • A shared secret must have the length the enc cipher expects.

Was this tool useful?