# Offline anonymisation for payment data

Payment data can be anonymised for reconciliation because matching needs identifiers, amounts, statuses and time, not people. Remove personal data, keep identifiers as shape-preserving hashes, keep the key with the data owner, run offline without third-party code, and test with planted markers, publishing whatever the test does not yet catch.

## Why payment data can be anonymised for reconciliation

Payment reconciliation needs facts about payments, not facts about people. To decide whether a payment in the merchant log matches the provider’s notification and statement line, a reconciliation compares identifiers, amounts, currencies, statuses and timestamps. It never needs the customer’s name, e-mail address, phone number or IP address. It does not need a full card number either. That makes reconciliation a good candidate for [anonymisation](https://reconora.com/glossary/anonymisation): the personal data can be removed before the data leaves the company, and the result is still exact. The idea is familiar from audit. An external auditor can check a ledger in which every name has been replaced by a code, as long as the codes are consistent. The codebook stays in the owner’s safe. This guide describes the method in general terms first, then what Reconora does.

## What must be removed

Anonymisation for payment data starts with a list of what must never leave. The list is longer than most teams expect, because personal data hides in many fields.

- **Direct identifiers:** names, e-mail addresses, phone numbers, postal addresses.
- **Network data:** IP addresses and device details.
- **Card and bank data:** full card numbers and bank account details such as IBANs. Card numbers are masked or removed.
- **Credentials:** tokens, passwords and keys that providers sometimes echo back in messages.
- **Document numbers:** passport, tax and identity numbers.
- **Business-sensitive names:** the names of payment providers, which reveal the merchant’s commercial relationships.

Free text needs the most care. Comments, error descriptions and raw message bodies can carry any of the above in any position. A field list alone will not catch them. The anonymiser needs rules for known fields and rules for free text, and the free-text rules will always be weaker.

## What must be kept, and in what form

Anonymisation is only useful if the reconciliation still works afterwards, so some values must survive in a usable form. Amounts, statuses, timestamps and currency precision are kept as they are. They describe the payment, not the person. Identifiers are the harder case. A transaction ID must still match between the log and the statement, so it cannot simply be deleted. The usual answer is a shape-preserving hash. The same input always produces the same output, so two sources that carried the same ID still carry the same code. The output also keeps the original’s format, such as `PAY-7F3A` becoming another value of the same length and pattern, so parsers and matching rules keep working. Providers and currencies are replaced by codes such as `Provider G` or `CUR-2`. A customer ID becomes a pseudonym, so repeated payments by one customer can still be grouped without knowing who the customer is.

## Why the key must stay with the data owner

The key decides who can reverse the anonymisation, so it must stay with the owner of the data. Every consistent code relies on something that maps codes back to values: an [encoding table](https://reconora.com/glossary/encoding-table), a secret used by the hash, or both. Whoever holds them can re-identify the data. If the vendor creates or stores the key, the data is not anonymous from the vendor’s point of view: the vendor can reverse the codes. The safer design creates the table and the secret at the owner’s site on first run and never sends them anywhere. The vendor reconciles the codes and returns results in the same codes. The owner decodes them locally. One question tests any offer of anonymised processing: can the vendor decode the data without the owner? If the answer is yes, the vendor holds a key.

## Why offline and standard-library-only matters for a security review

An anonymiser runs on raw personal data, so a security team will want to know exactly what it can do with it. Two properties make that question answerable. The first is offline operation. A module that makes no network calls cannot leak data while it runs, and a reviewer can confirm this by reading the code and by watching the machine. The second is a short dependency list. A module that uses only the standard library of its language has no third-party packages to audit, pin or trust. Every line that touches the data is in the module itself. Together, these two properties turn a security review from an assessment of an ecosystem into a reading of one folder. A third property follows from them: the source code should be given to the owner, so the review is of the code that actually runs.

## How to test anonymisation with planted markers

Planted-marker testing measures what an anonymiser misses, which is the figure a security team cares about. The method is simple. Take a copy of real data. Insert fictional personal values into it: invented e-mail addresses, phone numbers, card numbers, IBANs, IP addresses, names and document numbers. Put them in known fields and in free text, in the positions where real data hides. Run the anonymiser. Then search the output for every planted value and count how many failed to reach it. The result is a catch rate per kind of data. Two rules keep the test honest. The markers must be planted by someone other than the author of the rules. The test must be repeated on every release, against a threshold set in advance, so that a fix for one kind of data does not quietly break another.

## Why to publish the weak spots

Every anonymiser has a weak spot, and publishing it is part of the method rather than a confession. Some personal data has no reliable shape. A document number written in free text, with no word such as “passport” beside it, looks like any other numeric ID. Rules that catch it would also destroy the identifiers that reconciliation needs. The honest course is to measure the gap, publish it next to the release threshold, and describe the mitigation: keep such numbers under known field names, where they are caught. A security team that finds a gap on its own stops trusting every other figure. A security team that is told about it can judge the risk for its own data. A vendor that publishes only perfect results has either not tested hard enough or has chosen not to say.

## What Reconora does

Reconora’s [anonymiser](https://reconora.com/security/anonymiser) is an offline module that runs inside the merchant’s perimeter. It uses only the Python standard library and makes no network calls. The merchant receives its full source code. It removes names, e-mail addresses, phone numbers, IP addresses, postal addresses, bank account details, credentials and tokens, and document numbers under known field names. It masks card numbers to their first six and last four digits. It replaces providers and currencies with codes and keeps identifiers as shape-preserving hashes. The encoding table and the secret are created on first run at the merchant’s site and never leave it. What leaves is the anonymised package: provider and currency codes, hashed identifiers, amounts, statuses and timestamps, with a verification report and SHA-256 fingerprints. Names, e-mails, phones, IPs, full card numbers, IBANs, document numbers, provider names, the encoding table and the secret never leave. The [architecture](https://reconora.com/security/architecture) page shows what runs where.

## Measured results, including the weak spot

Reconora measured its anonymiser on one full merchant day: 1.5 million log records in 40.3 minutes on an ordinary laptop. Residual personal data under the module’s own rules: 0. In planted-marker testing, 100% of e-mail markers and 100% of card-number markers were caught, and 99.1% of names. The weak spot is document numbers in free text with no marker word beside them: 26.4% were caught, against a release threshold of 95%. That threshold is not met there yet. Under known field names, such numbers are caught completely. The full table is on the [security](https://reconora.com/security) page. A security team preparing its own assessment can start from the [security review](https://reconora.com/security/review) page.

[Start a free pilot](https://reconora.com/pilot) · [Book a 20-min call](https://calendar.google.com/calendar/appointments/schedules/AcZssZ2qcg1D27PGeYQ91fuYaSo7oy6D4tQ0onTGhC2mSdAWZpCuMUozMxIan4qYWtSk56H-hZTTZAC7)

---
Source: https://reconora.com/guides/offline-anonymisation · Updated 2026-10-18
