All projects

Professional work

Taxby AI.

API security & payload encryption

  • TLS 1.3
  • DPoP
  • JWE
  • ECDH-ES

The problem

Secure API requests need to protect sensitive payloads in transit and tie the access token to the client presenting it.

What I owned

I implemented the end-to-end payload encryption and integrated OAuth 2.0 DPoP. The request flow uses JWE with ECDH-ES for the payload and TLS 1.3 for the transport connection.

How a protected request flows

  1. Encrypt at the sender

    The sender packages the payload as JWE and uses ECDH-ES key agreement for the intended recipient.

  2. Send over TLS 1.3

    The client sends the encrypted payload over a protected connection with its access token and DPoP proof.

  3. Verify proof of possession

    The API verifies the proof and checks that the token is bound to the client key.

  4. Decrypt at the recipient

    The intended recipient uses its key material to decrypt the application payload.

Engineering decision

Protect the payload and bind the token

JWE keeps the payload encrypted until the intended recipient can decrypt it. DPoP requires proof that the token presenter holds the matching private key. TLS 1.3 protects the transport connection.