Skip to main content

Field Encryption & Tokenization

Most databases offer one at-rest answer: encrypt the whole volume. That protects against a stolen disk and nothing else — anyone with a valid query connection reads every column in plaintext, which is precisely the access path that matters for regulated data like card numbers, health records, and government identifiers.

Kilimanjaro protects the data at the field, not the disk. You declare which columns are sensitive in your schema; the platform enforces that declaration on every read and write, encrypting or tokenizing the value under your project's key so that a column is unreadable without authorization even to a caller holding a working database connection. There are two protection styles, chosen per field.

Declared fieldin your schemaEncrypted at restAES-256-GCM-SIV field keyRow holds ciphertextoptional equality blind indexTokenizedvalue leaves the databaseRow holds a tokenrandom or deterministicProject vaultvalue under the project keyRevealdecrypt or detokenize only under a stated-purpose policy; otherwise the column stays opaquePer-project keyfield key and vault token values wrap under it; erasing the project destroys it
A field is either encrypted in place or tokenized into the vault, and both stay behind the same reveal policy and the same per-project key.

1. Field-level encryption​

Mark a field encrypted and its value is encrypted at rest under a per-project field key (AES-256-GCM-SIV). It is encrypted on write and decrypted on read transparently — your application code reads and writes plaintext; the ciphertext is what lives in the row. A caller who reads the column without authorization gets ciphertext, not the cleartext value.

Encrypted columns are, by default, opaque to the query engine — you cannot range-scan, sort, or pattern-match on a value the database cannot see. For the common case where you need to find a record by an exact protected value — look up a customer by their encrypted national ID — a field can also be blind-indexed: the platform maintains a keyed index that supports equality lookup without decrypting the column. Blind indexing is equality-only by design: it answers "which row has exactly this value," not range, sort, prefix, full-text, or similarity queries. That boundary is the cost of keeping the value sealed.

2. Tokenization​

Encryption keeps the protected value in your database as ciphertext. Tokenization removes it entirely. Mark a field for vault tokenization and the real value leaves the customer database: the column holds only an opaque token, and the value itself lives in the project vault, encrypted under the project key.

This is the strongest form of de-scoping. Because the real value is not present in the database in any form — not even as ciphertext — the database is no longer in scope for the systems that store and process the sensitive value. For payment data, this is what takes a customer database out of PCI DSS scope: the primary account number is in the vault, and only a non-reversible token is in the row.

Tokens come in two shapes:

  • Random tokens (the default) — a random token with no relationship to the value it stands for. Non-reversible without the vault; two equal values produce different tokens. This is true PCI de-scoping.
  • Deterministic tokens (opt-in, for searchable fields) — equal values produce the same token, so the column still supports equality matching and joins, while the real value still lives only in the vault.

3. Reveal is policy-gated and audited​

Decrypting an encrypted field or detokenizing a vault token is not an ambient capability that any reader holds. A reveal is authorized against a stated-purpose policy — the caller declares why they need the cleartext, and the policy decides whether to release it. Reading a protected column without a satisfied reveal authorization returns it opaque, not in the clear. A sensitive value is released on a stated basis to an authorized caller; it is never handed back by default.

4. Both inherit cryptographic erasure​

A field key and the vault-stored token values wrap under the same per-project key that the rest of the project's data uses. That has a direct consequence for decommissioning: erasing the project destroys that key, which renders the encrypted ciphertext and the vault-held token values unrecoverable in one act — in live storage and in backups — with no separate erasure step per protected field. Field encryption and tokenization are not a second key system bolted on; they are the same custody and the same cryptographic erasure as everything else in the project.

5. Choosing between them​

You want to…Use
Protect a value at rest but still read/write it in place, optionally finding records by exact valueField-level encryption (encrypted, optionally blind-indexed)
Remove the value from your database entirely — strongest de-scoping, value lives only in the vaultTokenization (random for non-reversible, deterministic for equality matching)

Both render the protected column unreadable to a caller without authorization, both are governed by the reveal policy, and both inherit the project's cryptographic erasure. The practical difference is whether the protected value remains in your database as ciphertext (encryption) or leaves it entirely for the vault (tokenization).

The cryptography is classical and current-generation — AES-256-GCM-SIV for field encryption and key-wrapping, keyed HMAC-SHA-256 for blind indexes and deterministic tokens. For how field protection maps onto specific regulatory controls — PCI DSS 4.0 §3.5.1 (render the PAN unreadable wherever stored) and §3.5.1.2 (disk-level encryption alone is insufficient), and the equivalent at-rest controls across other frameworks — see Compliance.

6. See also​

  • Overview — the per-project key these fields are protected under.
  • Cryptographic Erasure — how erasing a project renders encrypted fields and tokenized values unrecoverable.
  • Audit Ledger — the signed, hash-chained record of the project's key-custody lifecycle.
  • Security → Compliance — how field protection maps onto regulatory at-rest controls.