AdvancedAction GuidePrivacy Compliance

Generate Synthetic Test Data Preserving Referential Integrity

Naive pseudonymization (replacing emails with random UUIDs) breaks referential integrity. If customer_id 847291 appears in both orders.csv and subscriptions.csv, random replacement breaks foreign key relationships—JOINs fail in staging. This workflow builds a deterministic mapping table via salted SHA-256 hashing, ensuring that customer 847291 always maps to the same synthetic email (e.g., [email protected]) across all related tables. The per-environment secret salt ensures staging data cannot be reverse-mapped without the salt. Safely clone production databases into staging without triggering GDPR Article 33 breach notifications.

DataPrep Engineering TeamPublished: 2025-07-10Last verified: 2026-07-153 min read

Why This Matters

A DevOps team used a simple REPLACE() script to mask emails for load testing. The import passed, but a misconfigured staging cron job processed 4,200 abandoned cart emails using the original domain portion, sending real customers emails with broken staging links. Each accidental email triggers a GDPR Article 33 breach notification requirement—costing an estimated $1.05M in legal administration across 4,200 notifications. Deterministic hashing with a .test.local domain prevents this entirely: even if cron fires, the emails are undeliverable.

Why Excel & Python Fail Here

The tension: random replacement breaks JOINs (bad for testing), but deterministic replacement without salt enables frequency analysis attacks (bad for privacy). The solution: deterministic hash WITH per-environment secret salt. Same input → same output (preserves JOINs), but the mapping is unrecoverable without the salt (prevents re-identification). The salt must be stored in a secrets manager, never in the data files.

CriterionExcel / SheetsPython / CloudDataPrep (This Page)
Max Rows ~150K (crashes) RAM-limited 1M+ via Wasm
Setup Time Manual formulas 30–60 min env setup 0 seconds
Data Privacy Local but fragile Uploads to cloud 100% in-browser
Cost License fees EC2 / SaaS $49+/mo Free forever

Step-by-Step Solution

We will use the GDPR Anonymizer to execute this entirely in your browser.

  1. 1

    Upload all related tables

    Drag and drop orders.csv, customers.csv, subscriptions.csv—any files that share foreign keys. The tool auto-detects join columns by name matching (customer_id, user_id, order_id).

  2. 2

    Configure deterministic mapping with salt

    The tool generates a random per-session salt (or accepts your environment-specific salt). All PII columns are hashed: SHA-256(salt + original_value) → deterministic synthetic value. Emails map to @test.local domain (undeliverable by design).

  3. 3

    Export all tables with preserved relationships

    Download all files. customer_id 847291 maps to the same synthetic identity across ALL tables. JOINs work perfectly in staging. The salt is displayed once for storage in your secrets manager.

Privacy Guarantee: Zero Bytes Uploaded

All processing happens in your browser via WebAssembly. Your data never touches a server. Try it: disconnect your Wi-Fi right now—the tool will still work.

Works fully offline · No cookies · No tracking pixels

Common Errors & Fixes

Error / SymptomRoot CauseFix
Staging emails sent to real customersPseudonymized emails retained original domain (@gmail.com) and staging cron firedUse .test.local domain for all synthetic emails—RFC 2606 reserves .test as non-deliverable
Foreign key JOINs fail in stagingRandom UUID replacement broke cross-table consistencyUse deterministic salted hashing: same input always produces same output across all tables

Frequently Asked Questions

Where should I store the salt?
In a secrets manager (AWS Secrets Manager, HashiCorp Vault, 1Password). NEVER in the data files, NEVER in version control. If the salt is lost, the mapping is unrecoverable—which is the point.
Can I reuse the same salt across environments?
Technically yes, but don't. Use a unique salt per environment (staging, QA, UAT). If one environment is compromised, the others remain protected.

Ready to clean your data?

100% local processing · Zero uploads · Blazing fast

Trusted by 2,400+ data teams · 18M+ rows processed monthly

DP

DataPrep Engineering Team

We build privacy-first data preparation tools that run entirely in your browser. Every workflow on this page has been tested against production datasets exceeding 500K rows. We verify each guide against real platform exports quarterly.

Last reviewed by the engineering team on 2026-07-15.