Payload Encryption & Decryption
Payload Encryption & Decryption
Secure AES-256-GCM payload encryption and decryption sandbox guide
To ensure absolute confidentiality and data integrity, webhook events and session results delivered by INFONITE can be configured with payload encryption. This page details both the encryption and decryption processes used to protect communication.
We use AES-256-GCM (Galois/Counter Mode) encryption. All encrypted payloads are returned as a Base64-encoded string prefixed with aes::.
The Encrypted Format
The encrypted payload is delivered as a string prefixed with aes:: followed by the Base64-encoded binary data.
The raw byte layout after decoding the Base64 portion follows a strict concatenation sequence:
Encryption & Decryption Workflows
Here is the technical walkthrough for implementing the cryptography pipelines.
Encryption Walkthrough
Decryption Walkthrough
Extract Payload Parts:
- IV (Initialization Vector): Extract the first 12 bytes.
- Tag (Authentication Tag): Extract the last 16 bytes.
- Ciphertext: Extract the middle bytes (everything between the first 12 bytes and the last 16 bytes).
Decrypt: Decrypt the Ciphertext using the AES-256-GCM algorithm with your allocated Session aes_key (configured during Create Session), the extracted IV, and the Tag.
Interactive Cryptography Sandbox
Test your GCM encryption and decryption logic directly in this sandbox tool. Toggle the switcher below to change between the Encrypt and Decrypt pipelines.
Implementation Code Examples
Select your preferred programming language tab below to copy production-ready code examples matching this AES-256-GCM specification.