JWS is the signing layer used to protect integrity and authenticity, while JWE is the encryption layer used to protect confidentiality. A signed token can still be read by anyone who has it, but only the holder of the right decryption key can inspect an encrypted token. In practice, teams often need JWS for verification and JWE only when claims must be hidden.
Why JWS and JWE Solve Different Problems in JWTs
JWS and JWE are different layers, not competing formats. JWS focuses on integrity and authenticity, so the recipient can verify who issued the token and whether it was altered. JWE focuses on confidentiality, so the token contents are hidden from anyone who cannot decrypt it. In most implementations, the practical question is whether the claims merely need to be trusted, or also need to be kept private.
The distinction matters because a JWT can be signed without being encrypted. That is useful when many parties need to validate the token, but it also means the payload can be inspected wherever the token is present. If claims contain sensitive data, a signed-only design exposes more than many teams expect, even when the signature is perfectly valid.
For a deeper explanation of signing mechanics and the token protection boundary, NHIMG’s JWT Security Guide is the best companion to this distinction.
How to Decide Whether Your Implementation Needs One or Both
The decision is usually driven by who must read the token, not just who must trust it. If the receiving service only needs to validate claims such as issuer, audience, expiry, or scopes, JWS is often enough. If claims include personal data, internal identifiers, or other sensitive attributes, JWE becomes relevant because the token may traverse browsers, proxies, logs, or intermediaries that should not see the payload.
Some systems use both. A common pattern is to sign first and then encrypt, so the recipient can both trust the issuer and keep the contents confidential. That said, layering both adds complexity: key management, debugging, token inspection, and interoperability all become harder, so it should be justified by a real confidentiality requirement rather than used by default.
NHIMG’s Digital Signatures Guide helps explain why JWS is fundamentally about tamper evidence and issuer authenticity, which is the first half of the design choice.
What Breaks When Teams Treat Signed and Encrypted Tokens as Equivalent
Confusing JWS with JWE usually leads to one of two failures: either sensitive claims are left readable when they should not be, or encryption is added where validation and trust were the real need. The first mistake creates exposure in places teams forget to audit, such as client-side storage, network traces, application logs, and downstream debugging tools. The second mistake can make implementations brittle without materially improving security.
Another practical failure is key handling. A signed token protects integrity only if the signing key remains under strong control. If the signing key is stolen or mismanaged, an attacker can mint apparently valid tokens, which is a far more serious failure than simple token disclosure. For teams that operate workload or service identities, NHIMG’s Token and Session Security Guide is useful because it places JWT handling in the broader context of token lifetime, replay, revocation, and binding.
Risk and Threat Considerations
Misunderstanding JWS versus JWE creates two distinct security risks: exposed claims when confidentiality was required, and forged trust when signing keys are compromised. The first risk is often operationally invisible because the token still validates, while the second can become a high-impact identity abuse path if a malicious party can mint tokens that receivers accept.
Failure mechanism: Teams rely on signature verification alone, or they place sensitive claims into a signed token that remains readable wherever it is transported or stored. If the signing material is stolen, attackers can also create valid-looking tokens that bypass downstream trust decisions.
Impact: Confidential claims can leak into logs, clients, intermediaries, and support tooling, and forged tokens can lead to unauthorized access, impersonation, or privilege escalation. Where token-signing infrastructure is involved, the consequences can be broad enough to affect many services at once, not just a single application.
When the integrity side of the problem is central, NHIMG’s Microsoft Storm-0558 key breach 2023 is a concrete reminder that compromised signing material can turn token trust into an attack path rather than a control.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack and risk surface, while OWASP ASVS, NIST SP 800-57 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP ASVS | V10 — OAuth and OIDC | JWT signing and encryption decisions directly affect token handling in OIDC/OAuth flows. |
| Recommendation — Apply V10 requirements to validate token handling, trust boundaries, and cryptographic expectations. | ||
| NIST SP 800-57 | Key Management | JWS and JWE both depend on correct key lifecycle, rotation, and protection practices. |
| Recommendation — Manage signing and decryption keys with explicit lifecycle and rotation rules. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | JWTs are identity-bearing material whose security depends on authenticators and their lifecycle. |
| SC-13 — Cryptographic Protection | JWS and JWE are cryptographic protections for integrity and confidentiality. | |
| Recommendation — Control token and key lifecycle to prevent misuse, replay, and unauthorized issuance. Use approved cryptography to protect token integrity and confidentiality. | ||
| OWASP API Security Top 10 | API2 — Broken Authentication | JWT misuse can undermine API authentication and accepted trust assumptions. |
| Recommendation — Validate JWT issuer, audience, expiry, and signing rules before accepting a token. | ||
Practitioner Guidance
What to verify: Check whether the token’s payload is expected to be visible to every party that can observe it in transit or at rest. If not, treat confidentiality as a design requirement, not an optional hardening step. Also verify that validation logic distinguishes “token is signed” from “token contents are safe to expose.”
Decision rule: If the token must be trusted by multiple services, use JWS for integrity; if the claims must remain hidden from any intermediate holder, add JWE only for those claims that genuinely need secrecy. Do not encrypt merely because the token is important, and do not sign merely because the token contains sensitive data.
Practitioner takeaway: The right choice is determined by the privacy of the claims and the trust boundary of the recipients, not by JWT format preference. JWS answers “can I trust this token?”, while JWE answers “who is allowed to read it?”
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 31, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org