Surrogates
- Realistic, never
<PERSON_1>:John SmithbecomesKasimir Sandoval,Johnalone becomesKasimir,JOHN SMITHbecomesKASIMIR SANDOVAL,john.smithin a URL becomeskasimir.sandoval,John'skeeps its's. - Deterministic per vault (HMAC of a vault secret), consistent across requests and a whole corpus, collision-free, and never equal to any real value the vault or your dictionary knows.
- Shape-preserving: emails stay valid on reserved
example.com/.org/.netdomains, phones use the fictional555-01xxrange with the original formatting, addresses keep number length, street suffix, unit and state (addresses outside the US style keep their street word, layout and postal code shape), phones in national formats keep the leading0or country code and the grouping, spoken numbers stay digit words, IPs use documentation ranges. - Locale-aware addresses: an address that reads as French, Spanish, Portuguese, Italian, German (including Austrian and Swiss forms), Dutch or UK gets a stand-in from the same country, with street names in that language’s grammar, a real mid-sized town and a postal code that fits it.
12 rue de Rivoli, 75001 Parisbecomes something like63 rue de Montreuil, 47000 Agen, andLindenstraße 8, 50674 Kölnsomething likeBergstraße 5, 35060 Marburg. Multi-word street and town names keep their word count and connectives (Jerez de la Fronterabecomes something likePalencia de la Sierra). Detection covers street-first and number-first forms, postcodes with a country prefix (CH-8001), floor and unit parts (2º B,Appt 12,Top 3), multi-line blocks and a trailing country line. A postcode and town with no street are masked only next to an address label or a street line. Danish, Swedish and Norwegian street forms are detected and get a generic stand-in. US-style addresses are generated exactly as before. - Family-name-first names get stand-ins from the same origin with the same shape:
Nguyen Van Anbecomes something likeKieu Van Phuc, andPark Ji-hoonsomething likeHwang Sook-kwan. - Handles do not keep the real initial:
kchenbecomessradcliffewhen the same request shows the person’s full name (so it matches their stand-in), and otherwise gets a different letter. - Name lists are bundled and generated for this project; once exhausted, a syllable generator takes over.
- Gender-consistent: first names are replaced with first names of the same likely gender (a bundled list of common first names; unknown names get gender-neutral surrogates), so
Priya ... herstays coherent. A dictionarygendercolumn overrides the guess. - One identity per person: every alias of a dictionary entry maps onto parts of the same surrogate.
Marcus DelaneybecomesEzra Sandoval,DelaneybecomesSandoval, and the nicknameMarcbecomes a nickname derived fromEzra(for exampleEz), so the model sees one person. - A surrogate is never a word that appears capitalized anywhere in the same request, so a stand-in cannot collide with a real name you are sending.
Source: README.md in the Outworld repository.