RFC 7516
1. Introduction
▶JWE provides confidentiality for JSON-based content. While JWS only signs (integrity), JWE encrypts the payload so only authorized recipients can read it.
In 5G, JWE is used on the N32-f (forwarding) interface between SEPPs. When roaming messages transit IPX providers, sensitive Information Elements (IEs) such as SUPI, authentication vectors, and subscriber data are encrypted using JWE to prevent IPX inspection.
2. JWE Structure
▶JWE separates key management (alg) from content encryption (enc). The Content Encryption Key (CEK) is generated randomly, used to encrypt the payload, then the CEK itself is encrypted/wrapped for each recipient.
JWE Compact Serialization (5 parts):
BASE64URL(Header)
.BASE64URL(Encrypted Key)
.BASE64URL(IV)
.BASE64URL(Ciphertext)
.BASE64URL(Authentication Tag)
Header: {"alg":"ECDH-ES+A256KW","enc":"A256GCM"}
Encrypted Key: Content Encryption Key wrapped with recipient's public key
IV: Initialization Vector for content encryption
Ciphertext: Encrypted payload
Auth Tag: AEAD authentication tag 3. Key Management Algorithms
▶| Algorithm | JWA Name | Description |
|---|---|---|
| ECDH-ES | ECDH-ES | Direct ECDH key agreement (single recipient) |
| ECDH-ES+A128KW | ECDH-ES+A128KW | ECDH + AES-128 key wrapping |
| ECDH-ES+A256KW | ECDH-ES+A256KW | ECDH + AES-256 key wrapping |
| RSA-OAEP-256 | RSA-OAEP-256 | RSA with OAEP padding + SHA-256 |
| A256KW | A256KW | AES-256 key wrapping (symmetric) |
4. N32-f Usage
▶The SEPP N32-f interface uses JWE to protect sensitive IEs in forwarded SBI messages:
- N32-c negotiation: SEPPs negotiate JWE algorithms and exchange public keys via N32-c (TLS-protected)
- Selective encryption: Only sensitive IEs are encrypted — non-sensitive parts remain as metadata for IPX routing
- Combined JWS+JWE: Messages can be both signed (JWS) and encrypted (JWE) — sign-then-encrypt
- Protected IEs: SUPI, GPSI, authentication vectors, session keys, subscriber profiles
5. Security Considerations
▶- JWE provides confidentiality but NOT integrity by default — combine with JWS for authenticated encryption
- Key management algorithm (alg) determines how the CEK is protected — ECDH-ES provides forward secrecy
- RSA-OAEP is preferred over RSAES-PKCS1-v1_5 (vulnerable to Bleichenbacher attacks)
- Compressed payloads inside JWE can lead to CRIME-style attacks — compression should be avoided