Payload Encryption
Encrypt what INFONITE sends you with AES-256-GCM, using a key only you hold
Everything sensitive the platform hands you — the results of a session, the payload of a webhook — can be delivered encrypted with a key that is yours. You mint it, you pass it once when you create the session, and from that moment the records exist in readable form only inside your own process.
Encrypted values are always self-describing: the name of the scheme, ::, and the Base64 of the encrypted bytes. Read the prefix first and handle what it says.
This page is about aes:: — AES-256-GCM, the scheme behind every session result and webhook payload, and the one your integration will use. The platform also accepts values encrypted towards it with RSA, for credentials travelling the other way; that is a different problem with a different answer, and it lives at the end of this page.
Encrypting with AES-256-GCM
AES-256-GCM (Galois/Counter Mode) with a 12-byte IV and a 16-byte authentication tag. GCM is authenticated encryption: decryption fails loudly if a single byte was altered in transit, so a payload that decrypts is a payload nobody touched.
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.
Sending values in the other direction
Everything above solves one problem: we send you data, and only you can read it. There is a second, separate problem — you send us a secret, and only we can read it — and it needs a different kind of key.
It comes up when your server hands us something an engine will use on the end user’s behalf, typically a set of credentials. A shared key is the wrong tool there: whoever can encrypt could also decrypt, and both sides holding the same secret is exactly what you do not want for someone else’s password.
So each application gets an RSA key pair whose private half is generated inside the platform and never leaves it. You receive the public key — a PEM you paste into your key store, exactly as you would any other public key. Encrypt with it and nobody downstream can read the value: not an intermediary, not a log, and not your own process once the value has been sent. (An X.509 certificate carrying that same public key is available too, for stacks that expect one; it is self-signed, so it is a container with a validity window rather than a chain of trust — the key inside it is what does the work.)
Two schemes travel that way, and the choice between them is a size limit, not a preference: