Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
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.

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.
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.
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.
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.
alg says leads directly to algorithm confusion, including the infamous none value.exp, nbf, iss, and aud on every request. A valid signature on a token issued by a different tenant, for a different audience, is still a valid signature.kid handling. If the key identifier is used to build a file path or a database query, path traversal and injection follow.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.
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.
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.
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.
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.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.