Protect the value, keep its shape
Mask or redact in the SQL so the clear value never leaves the database. Where an application needs a stable stand-in, return a format-preserving token: computed with FF1 or FF3-1, or random and sealed in a vault. Detokenizing needs a purpose and leaves a record.
Tokens that fit the column and still join
A token keeps the value’s shape: digits stay digits, separators stay where they are, and the last or first four can stay in clear for the people who need them. The same value in the same column always gets the same token, so joins and counts still work on tokenized data.
- Built-in formats — 7: numeric, last four, first four, three letter-and-digit variants and a random GUID
- Custom formats — by alphabet, characters kept left or right, and a prefix
- Per-column tweak — the same value in two columns gets two different tokens
- In the response — the
TOKENIZErule returns tokens to people, apps and agents
Computed, sealed, or one way
Vaultless FF1 or FF3-1 (NIST SP 800-38G Rev. 1) computes the token from the key and a per-column tweak. Vault mode issues a random token of the format and seals the value with AES-GCM, with a keyed HMAC so repeats get the same token. One-way mode is a keyed HMAC-SHA256 in the format’s shape, never reversible. Keys are references to your secret store or KMS and can be rotated.
- NIST test vectors — the FF1 and FF3-1 implementation is checked against NIST’s samples
- Keys by reference —
env://,aws-sm://,aws-kms://; the key material is never stored or shown
A purpose, a record and an allowance
Turning a token back into a value is a request: the scope, the tokens, the purpose on the record and the person. Each attempt is recorded, allowed or not, and each person has an allowance per period. A lead with a chargeback to answer gets the card number; an analyst looking for convenience is refused.
- Allowance — 1,000 tokens per 60 minutes per person by default
- Every attempt kept — who, when, purpose, scope, how many and the outcome
An agent asks for account numbers and gets tokens
The support assistant’s policy tokenizes account numbers in the response and limits it to 50 rows. It can tell a customer which of their accounts a payment came from by the last four digits, without ever holding the full number.
Where people stay in charge
- Detokenizing needs a stated purpose, is recorded, and is capped per person per period.
- Keys are rotated by a person; the key material stays in your secret store.