Skip to content
Blog

← All articles

The Mechanics of JWE: Key Wrapping, Authenticated Encryption, and Five-Part Tokens

What each of a JWE’s five parts holds, how “alg” delivers a one-time content key (RSA-OAEP, AES Key Wrap, ECDH-ES with Concat KDF, dir, PBES2) and how “enc” encrypts and authenticates the claims (AES-GCM, AES-CBC with HMAC), decrypted by hand with Web Crypto, plus why an encrypted token isn’t a signed one.

By 22 min read

Most JWTs are signed: anyone can read the claims, and the signature proves who issued them and that they haven’t changed. Sometimes that’s not enough, because the token carries something the client or a proxy shouldn’t see: an email address, an internal account number, a permission set. For that, the JOSE standards define JSON Web Encryption (JWE, RFC 7516): a token whose claims are encrypted.

A JWE looks like a JWT with two extra dots, and that’s where the resemblance ends. Inside are two separate layers of cryptography, a choice of seven ways to deliver the key, and a few sharp edges that have caught real libraries. This article opens it up, decrypts tokens by hand using only the Web Crypto API, and shows how to use it safely. Every code example was run before publishing, against the jose library and Python’s jwcrypto.

The short answer#

Signed tokens and encrypted tokens#

“JWT” describes the claims format (RFC 7519). The claims travel inside one of two containers. A JWS (JSON Web Signature, RFC 7515) has three parts and protects integrity: everyone can read it, but only the key holder can create it. A JWE has five parts and protects confidentiality: only the key holder can read it. The algorithms both use are listed in RFC 7518 (JWA), and the keys in RFC 7517 (JWK). All five RFCs were published together in May 2015.

JWS (signed)JWE (encrypted)
Parts3: header . payload . signature5: header . encrypted key . IV . ciphertext . tag
Who can read the claimsAnyoneOnly the holder of the decryption key
Who can create a valid tokenOnly the holder of the signing keyWith a public key: anyone. With a shared key: only those who share it
Header fieldsalgalg and enc

The five parts#

Here is a JWE made with the jose library, and the size of each of its parts:

create.mjs
// create.mjs: make an encrypted JWT with the jose library (npm install jose).
import { EncryptJWT, generateKeyPair, exportJWK, jwtDecrypt } from "jose";
import { writeFileSync } from "node:fs";

// The recipient's key pair. Whoever has the public key can encrypt; only the private key decrypts.
const { publicKey, privateKey } = await generateKeyPair("RSA-OAEP-256", { extractable: true });

const token = await new EncryptJWT({ sub: "42", email: "ada@example.com" })
  .setProtectedHeader({ alg: "RSA-OAEP-256", enc: "A256GCM" }) // alg: how the key travels; enc: how the data is encrypted
  .setIssuedAt()
  .setExpirationTime("15m")
  .encrypt(publicKey);

const names = ["protected header", "encrypted key", "IV", "ciphertext", "tag"];
token.split(".").forEach((part, i) => console.log(`${names[i].padEnd(16)} ${String(part.length).padStart(3)} characters`));
// protected header  51 characters  ({"alg":"RSA-OAEP-256","enc":"A256GCM"}, 38 bytes)
// encrypted key    342 characters  (256 bytes: one RSA-2048 block)
// IV                16 characters  (12 bytes)
// ciphertext        96 characters  (72 bytes: exactly as long as the claims JSON)
// tag               22 characters  (16 bytes)

const { payload } = await jwtDecrypt(token, privateKey);
console.log(payload.email); // ada@example.com

// Saved for by-hand.mjs, which decrypts the same token without jose.
writeFileSync("token.txt", token);
writeFileSync("private.jwk.json", JSON.stringify(await exportJWK(privateKey)));

A compact JWE: five base64url parts separated by dots

1. Protected header
2. Encrypted key
3. IV
4. Ciphertext
5. Tag

An RSA-OAEP-256 token with two claims. The other parts are to scale; the encrypted key is drawn shorter than its real 342 characters. With other algorithms it is much smaller, or empty.

A compact JWE. Only the header is readable; parts 2 to 5 are encrypted or contain random bytes.
  1. Protected header: JSON saying how to decrypt, base64url-encoded but not encrypted. At minimum, alg and enc; sometimes a key ID (kid), a content type (cty), and algorithm parameters.
  2. Encrypted key: the content encryption key, encrypted for the recipient. Empty for algorithms where the recipient already has or can derive the key.
  3. Initialization vector: random bytes for the content encryption (12 for GCM, 16 for CBC).
  4. Ciphertext: the encrypted claims. With GCM it’s exactly as long as the plaintext; with CBC it’s padded to a multiple of 16 bytes.
  5. Authentication tag: proves that nothing in the token, header included, was changed.

Two layers: “alg” and “enc”#

A JWE is a hybrid encryption scheme, the same pattern used by PGP, TLS, and S/MIME: a fast symmetric cipher encrypts the data with a one-time key, and a key-management step delivers that key. In JWE terms:

  1. 1Make a CEKA random content encryption key, new for every token.
  2. 2Deliver it (alg)Encrypt the CEK for the recipient, or agree on it, or use a shared key directly.
  3. 3Encrypt the claims (enc)AES-GCM or AES-CBC + HMAC, with a random IV.
  4. 4Authenticate the headerThe header’s base64url text is the additional authenticated data.
  5. 5Assembleheader . encrypted key . IV . ciphertext . tag
How a JWE is built. Decryption runs the same steps in reverse.

The two choices are independent: any alg can be combined with any enc. That’s what lets the same token format serve a server encrypting for itself with a shared key, a client encrypting for an API’s RSA key, and an IoT device using elliptic-curve key agreement.

Decrypting a JWE by hand#

Libraries hide the mechanics, so here’s the token from create.mjs decrypted with only the Web Crypto API, built into Node.js, Deno, Bun, and browsers:

by-hand.mjs
// by-hand.mjs: decrypt the JWE from create.mjs with only the Web Crypto API, to see every step.
import { readFileSync } from "node:fs";

const b64url = (s) => Buffer.from(s, "base64url");
const [header, encryptedKey, iv, ciphertext, tag] = readFileSync("token.txt", "utf8").split(".");
console.log(JSON.parse(b64url(header))); // { alg: 'RSA-OAEP-256', enc: 'A256GCM' }

// Step 1, "alg": RSA-OAEP with SHA-256 unwraps the content encryption key (CEK).
const jwk = JSON.parse(readFileSync("private.jwk.json", "utf8"));
const rsa = await crypto.subtle.importKey("jwk", jwk, { name: "RSA-OAEP", hash: "SHA-256" }, false, ["decrypt"]);
const cek = await crypto.subtle.decrypt({ name: "RSA-OAEP" }, rsa, b64url(encryptedKey));
console.log(cek.byteLength); // 32: a fresh random AES-256 key, made for this token only

// Step 2, "enc": AES-256-GCM decrypts the claims. The additional authenticated data is the header,
// exactly as it appears in the token (its base64url text), so changing the header breaks decryption.
const aes = await crypto.subtle.importKey("raw", cek, "AES-GCM", false, ["decrypt"]);
const plaintext = await crypto.subtle.decrypt(
  { name: "AES-GCM", iv: b64url(iv), additionalData: new TextEncoder().encode(header) },
  aes,
  Buffer.concat([b64url(ciphertext), b64url(tag)]), // Web Crypto expects the tag at the end
);
console.log(JSON.parse(new TextDecoder().decode(plaintext)).email); // ada@example.com

That’s all a JWE is: two standard operations. Step 1 depends on alg, and step 2 on enc. For background on the primitives themselves, see our guides to AES-GCM in JavaScript and to RSA, hybrid encryption and key agreement.

The header isn’t encrypted, since the recipient needs to read it before decrypting, but it is protected. Its exact base64url text is passed to the cipher as additional authenticated data (AAD), so the authentication tag covers it along with the ciphertext:

tamper.mjs
// tamper.mjs: the header is authenticated even though it isn't encrypted.
import { compactDecrypt, importJWK } from "jose";
import { readFileSync } from "node:fs";

const token = readFileSync("token.txt", "utf8");
const key = await importJWK(JSON.parse(readFileSync("private.jwk.json", "utf8")), "RSA-OAEP-256");
const [, ...rest] = token.split(".");

// Swap in a header with an extra field. The encrypted key still decrypts; the tag check doesn't pass.
const header = Buffer.from(JSON.stringify({ alg: "RSA-OAEP-256", enc: "A256GCM", kid: "attacker" })).toString("base64url");
await compactDecrypt([header, ...rest].join("."), key).catch((e) => console.log(e.code)); // ERR_JWE_DECRYPTION_FAILED

// Flip one bit of the ciphertext: same result.
const parts = token.split(".");
const c = Buffer.from(parts[3], "base64url");
c[0] ^= 1;
parts[3] = c.toString("base64url");
await compactDecrypt(parts.join("."), key).catch((e) => console.log(e.code)); // ERR_JWE_DECRYPTION_FAILED

This matters because the header controls decryption. An attacker who could change enc or kid without detection could steer the recipient toward a weaker algorithm or a different key. Note that the check covers the header’s text, not its meaning: re-encoding the same JSON with different spacing or key order also breaks the tag.

Key management: seven ways to deliver a key#

The alg value picks how the content encryption key reaches the recipient. Here are the main options, each encrypting the same claims:

modes.mjs
// modes.mjs: the same claims, encrypted with each kind of "alg". Watch part 2 and the header.
import { CompactEncrypt, generateKeyPair, decodeProtectedHeader } from "jose";

const claims = new TextEncoder().encode('{"sub":"42"}');
const aesKey = (bits) => crypto.getRandomValues(new Uint8Array(bits / 8));
const cases = [
  ["RSA-OAEP-256", (await generateKeyPair("RSA-OAEP-256")).publicKey],
  ["ECDH-ES", (await generateKeyPair("ECDH-ES", { crv: "X25519" })).publicKey],
  ["ECDH-ES+A256KW", (await generateKeyPair("ECDH-ES+A256KW", { crv: "X25519" })).publicKey],
  ["A256KW", aesKey(256)],
  ["A256GCMKW", aesKey(256)],
  ["dir", aesKey(256)], // the shared key IS the content encryption key
  ["PBES2-HS256+A128KW", new TextEncoder().encode("a passphrase")],
];
for (const [alg, key] of cases) {
  const jwe = await new CompactEncrypt(claims).setProtectedHeader({ alg, enc: "A256GCM" }).encrypt(key);
  const extra = Object.keys(decodeProtectedHeader(jwe)).filter((k) => k !== "alg" && k !== "enc");
  console.log(`${alg.padEnd(19)} encrypted key: ${String(jwe.split(".")[1].length).padStart(3)} chars, extra header fields: ${extra.join(", ") || "none"}`);
}
algModeRecipient’s keyPart 2
RSA-OAEP-256Key encryptionRSA private keyThe CEK, RSA-encrypted (256 bytes for RSA-2048)
A256KWKey wrapping (RFC 3394)Shared AES keyThe CEK, wrapped (40 bytes for a 32-byte CEK)
A256GCMKWKey wrapping with AES-GCMShared AES keyThe CEK, encrypted; its IV and tag go in the header
ECDH-ESDirect key agreementEC or X25519 private keyEmpty: the CEK is derived
ECDH-ES+A256KWKey agreement, then key wrappingEC or X25519 private keyThe CEK, wrapped with the agreed key
dirDirect encryptionShared key, used as the CEKEmpty
PBES2-HS256+A128KWPassword-basedA passwordThe CEK, wrapped with a key derived by PBKDF2 (p2s salt, p2c iterations in the header)

AES Key Wrap (A128KW, A256KW) is a deterministic algorithm designed for encrypting keys; it adds an 8-byte integrity check value, which is why a 32-byte CEK becomes 40 bytes (54 characters). It needs no IV, because the thing being encrypted is itself random. Web Crypto supports it directly as AES-KW.

dir skips key management entirely: the shared key is the CEK. It produces the smallest tokens, and it suits a server that encrypts tokens for itself, such as session data in a cookie. In our test, a dir JWE was 132 characters, smaller than an ES256-signed JWT of the same claims (159). An RSA-OAEP-256 JWE was 486.

ECDH-ES and the Concat KDF#

With ECDH-ES, no part of the key is sent at all. The sender creates a one-time (ephemeral) key pair, puts its public half in the header as epk, and combines its private half with the recipient’s public key. The recipient does the reverse and gets the same shared secret. That secret then goes through the Concat KDF from NIST SP 800-56A, which mixes in the algorithm name and optional party information (apu, apv) so a secret agreed for one purpose can’t be reused for another:

ecdh-es.mjs
// ecdh-es.mjs: decrypt an ECDH-ES token by hand. There is no encrypted key: both sides derive the CEK.
import { CompactEncrypt, generateKeyPair, exportJWK } from "jose";

// The recipient's long-term X25519 key pair; the sender only needs the public half.
const recipient = await generateKeyPair("ECDH-ES", { crv: "X25519", extractable: true });
const token = await new CompactEncrypt(new TextEncoder().encode("agreed, not sent"))
  .setProtectedHeader({ alg: "ECDH-ES", enc: "A256GCM" })
  .encrypt(recipient.publicKey);

const [header, encryptedKey, iv, ciphertext, tag] = token.split(".");
const { epk, apu = "", apv = "" } = JSON.parse(Buffer.from(header, "base64url"));
console.log(encryptedKey === "", epk.crv); // true X25519: the sender's one-time public key is in the header

// 1. Key agreement: our private key + the sender's ephemeral public key = the shared secret Z.
const priv = await crypto.subtle.importKey("jwk", await exportJWK(recipient.privateKey), { name: "X25519" }, false, ["deriveBits"]);
const pub = await crypto.subtle.importKey("jwk", epk, { name: "X25519" }, false, []);
const z = new Uint8Array(await crypto.subtle.deriveBits({ name: "X25519", public: pub }, priv, 256));

// 2. Concat KDF (NIST SP 800-56A), one SHA-256 round for a 256-bit key. Every field is length-prefixed.
const u32 = (n) => { const b = new Uint8Array(4); new DataView(b.buffer).setUint32(0, n); return b; };
const field = (bytes) => Buffer.concat([u32(bytes.length), bytes]);
const otherInfo = Buffer.concat([
  field(Buffer.from("A256GCM")), // AlgorithmID: the "enc" value for direct ECDH-ES
  field(Buffer.from(apu, "base64url")), // PartyUInfo (empty here)
  field(Buffer.from(apv, "base64url")), // PartyVInfo (empty here)
  u32(256), // SuppPubInfo: key length in bits
]);
const cek = await crypto.subtle.digest("SHA-256", Buffer.concat([u32(1), z, otherInfo]));

// 3. Content decryption, exactly as before.
const aes = await crypto.subtle.importKey("raw", cek, "AES-GCM", false, ["decrypt"]);
const plaintext = await crypto.subtle.decrypt(
  { name: "AES-GCM", iv: Buffer.from(iv, "base64url"), additionalData: new TextEncoder().encode(header) },
  aes,
  Buffer.concat([Buffer.from(ciphertext, "base64url"), Buffer.from(tag, "base64url")]),
);
console.log(new TextDecoder().decode(plaintext)); // agreed, not sent

Our hand-written version derives exactly the same key as jose, which is how the token decrypts. With ECDH-ES+A256KW, the derived key isn’t the CEK but a key-wrapping key, which allows a single token to be encrypted for multiple recipients in JWE’s JSON serialization.

Content encryption: GCM and CBC-HMAC#

The enc value picks one of two families, both authenticated:

  • A128GCM, A192GCM, A256GCM: AES-GCM with a 96-bit IV and a 128-bit tag. Fast, compact, supported by Web Crypto directly, and the usual choice.
  • A128CBC-HS256, A192CBC-HS384, A256CBC-HS512: AES-CBC for encryption, then HMAC over the result (encrypt-then-MAC). The CEK is twice as long because it’s two keys: the first half for HMAC, the second for AES.

The CBC-HMAC construction is worth seeing once, because it shows what “authenticated encryption” has to cover. The HMAC input is the AAD, the IV, the ciphertext, and the AAD’s length in bits; the tag is the first half of the HMAC output:

cbc-hs.mjs
// cbc-hs.mjs: A128CBC-HS256 by hand (RFC 7518, section 5.2), then decrypted by jose to prove it's right.
import { compactDecrypt } from "jose";

const enc = new TextEncoder();
const b64url = (b) => Buffer.from(b).toString("base64url");

export async function encryptCbcHs256(cek, plaintext, header) {
  const macKey = cek.slice(0, 16); // the 32-byte CEK is two keys: first half for HMAC...
  const encKey = cek.slice(16); // ...second half for AES-128-CBC
  const iv = crypto.getRandomValues(new Uint8Array(16));
  const aes = await crypto.subtle.importKey("raw", encKey, "AES-CBC", false, ["encrypt"]);
  const ciphertext = new Uint8Array(await crypto.subtle.encrypt({ name: "AES-CBC", iv }, aes, plaintext)); // PKCS#7 padding

  const aad = enc.encode(b64url(enc.encode(JSON.stringify(header))));
  const al = new Uint8Array(8);
  new DataView(al.buffer).setBigUint64(0, BigInt(aad.length * 8)); // AAD length in bits, 64-bit big-endian
  const hmac = await crypto.subtle.importKey("raw", macKey, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
  const mac = new Uint8Array(await crypto.subtle.sign("HMAC", hmac, Buffer.concat([aad, iv, ciphertext, al])));
  const tag = mac.slice(0, 16); // the tag is the first half of the HMAC

  return [new TextDecoder().decode(aad), "", b64url(iv), b64url(ciphertext), b64url(tag)].join(".");
}

const cek = crypto.getRandomValues(new Uint8Array(32));
const token = await encryptCbcHs256(cek, enc.encode("encrypt-then-MAC, by hand"), { alg: "dir", enc: "A128CBC-HS256" });
const { plaintext } = await compactDecrypt(token, cek);
console.log(new TextDecoder().decode(plaintext)); // encrypt-then-MAC, by hand

jose decrypted our hand-made token, and so did Python’s jwcrypto in our tests. The AAD length is there so the HMAC input can only be split one way: without it, the boundary between the header and the rest would be ambiguous. Prefer GCM for new tokens; CBC-HMAC exists mainly for platforms without GCM.

Encrypted is not signed#

This is the most important point in the article. With a public-key algorithm (RSA-OAEP or ECDH-ES), the token is encrypted using the recipient’s public key, which is public. Anyone can create a JWE that decrypts perfectly, with any claims they like. Successful decryption proves the token was made for you, not that it was made by anyone you trust:

nested.mjs
// nested.mjs: encryption alone doesn't say who made the token. Sign first, then encrypt.
import { SignJWT, EncryptJWT, CompactEncrypt, compactDecrypt, jwtDecrypt, jwtVerify, generateKeyPair } from "jose";

const issuer = await generateKeyPair("ES256"); // the auth server's signing key
const recipient = await generateKeyPair("RSA-OAEP-256"); // the API's decryption key

// The danger: the recipient's key is PUBLIC, so anyone can produce a JWE that decrypts perfectly.
const forged = await new EncryptJWT({ sub: "42", admin: true })
  .setProtectedHeader({ alg: "RSA-OAEP-256", enc: "A256GCM" })
  .encrypt(recipient.publicKey);
console.log((await jwtDecrypt(forged, recipient.privateKey)).payload.admin); // true: decrypting proves nothing

// The fix: a signed JWT (JWS) inside the JWE, marked with cty: "JWT".
const jws = await new SignJWT({ sub: "42", admin: false }).setProtectedHeader({ alg: "ES256" }).setIssuedAt().sign(issuer.privateKey);
const token = await new CompactEncrypt(new TextEncoder().encode(jws))
  .setProtectedHeader({ alg: "RSA-OAEP-256", enc: "A256GCM", cty: "JWT" })
  .encrypt(recipient.publicKey);

async function accept(t) {
  const { plaintext, protectedHeader } = await compactDecrypt(t, recipient.privateKey); // 1. decrypt
  if (protectedHeader.cty !== "JWT") throw new Error("expected a nested JWT");
  return (await jwtVerify(new TextDecoder().decode(plaintext), issuer.publicKey)).payload; // 2. verify the signature
}
console.log((await accept(token)).admin); // false
await accept(forged).catch((e) => console.log(e.message)); // expected a nested JWT

The standard answer is a nested JWT (RFC 7519, section 5.2): sign the claims as a JWS, then encrypt the signed token as the JWE’s payload, with cty: "JWT" in the header. The recipient decrypts, then verifies the signature against the issuer’s key. Sign first, then encrypt, so the signature itself is hidden too.

With a shared symmetric key (dir, A256KW, A256GCMKW), the authentication tag does show that the creator knew the key. That’s enough when the only parties are those who share it, for example, a server encrypting its own session cookies.

Pitfalls and past vulnerabilities#

  • RSA1_5. RSA with PKCS #1 v1.5 padding is vulnerable to Bleichenbacher’s padding-oracle attack, and the JWT best-practices RFC (RFC 8725) advises against it. jose 6 doesn’t support it at all; use RSA-OAEP-256.
  • Invalid-curve attacks on ECDH-ES. In 2017, Antonio Sanso showed that several JOSE libraries accepted an epk that wasn’t on the expected curve, allowing an attacker to recover the recipient’s private key across multiple requests. Libraries must validate the point; X25519 avoids most of this risk by design.
  • PBES2 as a denial-of-service. The iteration count p2c comes from the token itself, so an attacker can send p2c: 2147483647 and make the server hash for minutes. jose added a limit after this was reported (CVE-2022-36083). In our test, jose 6 refuses PBES2 tokens entirely unless you allow the algorithm, and rejected a p2c of 600,000 unless maxPBES2Count was raised.
  • Compression. The zip: "DEF" header compresses the claims before encryption. Compressing secret data next to attacker-controlled data can leak the secret through the ciphertext length, and a small token can decompress to something huge. RFC 8725 recommends avoiding it.
  • Accepting any algorithm. The header chooses the algorithm, so a recipient that accepts any alg or enc lets the sender choose the weakest one it supports. Pin both:
safe-decrypt.mjs
// safe-decrypt.mjs: accept exactly the algorithms you issue, nothing else.
import { jwtDecrypt, EncryptJWT, generateKeyPair } from "jose";

const { publicKey, privateKey } = await generateKeyPair("RSA-OAEP-256");
const options = {
  keyManagementAlgorithms: ["RSA-OAEP-256"], // allowlist for "alg"
  contentEncryptionAlgorithms: ["A256GCM"], // allowlist for "enc"
  issuer: "https://auth.example.com",
  audience: "https://api.example.com",
};

const good = await new EncryptJWT({ sub: "42" }).setProtectedHeader({ alg: "RSA-OAEP-256", enc: "A256GCM" })
  .setIssuer(options.issuer).setAudience(options.audience).setExpirationTime("15m").encrypt(publicKey);
console.log((await jwtDecrypt(good, privateKey, options)).payload.sub); // 42

const odd = await new EncryptJWT({ sub: "42" }).setProtectedHeader({ alg: "RSA-OAEP-256", enc: "A128CBC-HS256" })
  .setIssuer(options.issuer).setAudience(options.audience).encrypt(publicKey);
await jwtDecrypt(odd, privateKey, options).catch((e) => console.log(e.code)); // ERR_JOSE_ALG_NOT_ALLOWED

When to use JWE#

  • Tokens that pass through parties who shouldn’t read them: a browser or mobile app holding a token meant for a backend API, or OpenID Connect ID tokens with personal data, which the specification allows clients to request encrypted.
  • Stateless encrypted sessions: a server storing session data in a cookie, encrypted with a shared key (dir + A256GCM).
  • Not needed when the token only carries an opaque user ID and permissions that aren’t sensitive; a signed JWT is simpler. And if the server keeps state anyway, an opaque random token with a database lookup avoids putting data in the token at all.

FAQ#

Can I tell a JWE from a JWS without the key?

Yes: count the dots. Five parts is a JWE, three is a JWS. The JWE’s header is readable, so you can also see its alg and enc. Our JWE tool decodes all five parts and decrypts them if you have the key.

Why does the token need a new CEK every time?

So that the content key is never reused. GCM, in particular, breaks badly if the same key and IV are used twice. A fresh random CEK and IV per token make that practically impossible, even when the long-term key stays the same for years. (With dir, the shared key is reused, so the random IV carries that burden alone.)

Should I sign then encrypt, or encrypt then sign?

For JWTs, sign then encrypt. The signature stays hidden, the recipient verifies after decrypting, and it’s the form RFC 7519 and most libraries expect for nested tokens.

How much bigger is a JWE than a JWS?

It depends on alg. With dir, it can be smaller, as our test showed. RSA-OAEP adds the encrypted key, about 342 characters for RSA-2048. ECDH-ES adds the ephemeral public key to the header instead, which, with X25519, is much smaller: 251 characters in total in our test, compared to 486 for RSA.

Try it in your browser

  • JWE Decoder, Encoder & Editor: see a token’s five parts, decrypt it with a private key, shared key or password, and create tokens with every algorithm in this article.
  • JWT Decoder: inspect the signed JWT inside a nested token once it’s decrypted.