What is compact JWE?
JSON Web Encryption (JWE) protects content with authenticated encryption. Compact serialization has five dot-separated parts: protected header, encrypted key, initialization vector, ciphertext, and authentication tag. This tool deliberately supports a narrow modern profile: direct 256-bit symmetric keys with A256GCM, or RSA-OAEP-256 key wrapping with A256GCM content encryption.
How to encrypt, decrypt, or inspect a JWE
- 1Choose direct symmetric encryption or RSA-OAEP-256, then provide plaintext and the matching key.
- 2For direct mode, paste or generate a 32-byte oct JWK. For RSA encryption, provide a public RSA JWK or SPKI PEM.
- 3To decrypt, paste a compact JWE and the matching symmetric JWK or RSA private JWK/PKCS#8 PEM.
- 4Use header inspection to view alg, enc, kid, and other protected fields without supplying a key.
- 5Treat header-only results as unverified metadata until authenticated decryption succeeds.
Common JWE use cases
Testing an API encryption integration
Create interoperable compact JWE samples with explicit modern algorithms while debugging a service or client implementation.
Diagnosing a JWE configuration mismatch
Inspect protected alg, enc, and kid fields before decryption to identify a wrong key type or unsupported algorithm.
Verifying local decryption keys
Confirm that a symmetric JWK or RSA private key can authenticate and decrypt a known compact JWE without sending it to a third party.
Frequently asked questions
Can I trust a protected header inspected without decrypting?
No. Anyone can construct header-looking text. The header becomes authenticated only when decryption verifies the JWE authentication tag with the correct key.
Which algorithms are supported?
Only dir with A256GCM and RSA-OAEP-256 with A256GCM. Unsupported or legacy algorithms are rejected explicitly.
Are encrypted PEM private keys supported?
No. The browser import path used here supports unencrypted PKCS#8 PEM private keys. Encrypted PEM input is rejected rather than silently mishandled.