Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Are JOSE, JWS and JWE?

JOSE is the family of JSON-based cryptography standards. JWS signs a payload, JWE encrypts one, JWK describes keys, and JWT is the claims format that usually rides inside a JWS.

Illustration for the cybersecurity term JOSE, JWS and JWE
Home / Blog / Cybersecurity Terms / What Are JOSE, JWS and JWE?
17 November 2026

What Are JOSE, JWS and JWE?

What Are JOSE, JWS and JWE?

JOSE — JavaScript Object Signing and Encryption — is the set of IETF standards that define how to sign, encrypt, and describe cryptographic material using JSON and URL-safe Base64. If you have worked with OAuth 2.0, OpenID Connect, or any modern API gateway, you have been using it, probably without reading the specifications.

Five documents matter: JWS for signatures (RFC 7515), JWE for encryption (RFC 7516), JWK for key representation (RFC 7517), JWA for the algorithm registry (RFC 7518), and JWT for the claims format (RFC 7519). The common confusion is worth clearing up immediately: a JWT is not a format of its own. It is a set of claims carried inside either a JWS or a JWE, and in practice almost always a JWS.

JWS: Three Parts

A compact JWS is three Base64url segments separated by full stops: the protected header, the payload, and the signature. The header declares the algorithm and, usually, a key identifier:

{"alg":"RS256","kid":"2024-11-signing","typ":"JWT"}

The signature covers the encoded header and payload together, so neither can be altered. The payload itself is only encoded, not encrypted — anyone holding the token can read every claim in it. This surprises developers regularly, and it is why access tokens should never carry anything the client should not see.

Common algorithms are HS256, which is HMAC-SHA256 with a shared secret, RS256 and PS256 using RSA, ES256 using ECDSA on P-256, and EdDSA using Ed25519. Symmetric HS256 is appropriate only where issuer and verifier are the same trust domain; anything verified by third parties needs an asymmetric algorithm so the verifier holds only a public key.

JWE: Five Parts

A compact JWE has five segments: header, encrypted key, initialisation vector, ciphertext, and authentication tag. Two algorithm fields appear in the header. The alg parameter describes how the content encryption key is protected — RSA-OAEP-256, ECDH-ES+A256KW, A256KW for symmetric key wrapping, or dir for a pre-shared key. The enc parameter names the content cipher, normally A256GCM.

This two-layer structure is envelope encryption expressed in a token. Use JWE when a token must cross a boundary where its contents should stay hidden, for example an identity token passing through a client application. Nested tokens, signed and then encrypted, are permitted and specified, but add complexity that is rarely justified.

Keys and Discovery

A JWK is a JSON object describing a key: its type, curve or modulus, usage, algorithm, and key identifier. A JWKS is a set of them, published at a URL such as /.well-known/jwks.json, which is how OpenID Connect providers distribute verification keys and how rotation happens without coordination. The verifier fetches the set, caches it, and selects by kid.

Three header fields exist to point at keys from inside the token itself: jku (a URL to a key set), x5u (a URL to a certificate), and jwk (an embedded key). All three are attacker-controlled input. Unless you have a specific need and a strict allowlist of hosts, reject tokens that use them — an unvalidated jku is both a signature bypass and a server-side request forgery.

The Mistakes That Matter

These appear in nearly every API assessment we run. Our web application security services test token handling specifically, because a flaw here is usually an authentication bypass rather than a minor finding.

FAQ – Frequently Asked Questions

Is the Payload of a JWT Encrypted?

Not in the usual case. A signed token, which is a JWS, Base64url-encodes its claims so anyone holding the token can read them. Encryption requires a JWE. Treat every claim in a signed token as public, and never place personal data, internal identifiers, or secrets in one unless it is also encrypted.

Should I Use JWS or JWE?

JWS for most purposes: it proves who issued the token and that it has not been altered, which is what an API needs. Add JWE where the content itself must stay hidden from a party that legitimately holds the token, such as a browser or a third-party relying service. Nest them only if you genuinely need both.

How Do I Rotate Signing Keys Safely?

Publish a JWKS containing both the old and the new key, each with a distinct kid, and have issuers start signing with the new one. Verifiers select by kid, so both remain valid during the overlap. Remove the old key once every token signed with it has expired, allowing for verifier caching intervals.

What Should My Verifier Reject Outright?

Tokens whose alg is not on your allowlist, anything using none, tokens carrying jku, x5u, or embedded jwk headers unless you specifically support them with a host allowlist, tokens with a missing or wrong aud or iss, and anything expired or not yet valid. Reject before parsing claims, not after.

Related Terms

You May Be Interested In These

What Is Covenant C2?

Cybersecurity Terms

17 November 2026

What Is Covenant C2?

Read More
What Is Metasploit?

Cybersecurity Terms

17 November 2026

What Is Metasploit?

Read More
What Is AI Hallucination?

Cybersecurity Terms

17 November 2026

What Is AI Hallucination?

Read More