{"id":50570508,"url":"https://github.com/phax/ph-redact","last_synced_at":"2026-06-04T18:00:49.039Z","repository":{"id":353648937,"uuid":"1220311070","full_name":"phax/ph-redact","owner":"phax","description":"Simple eInvoice Anonymizer","archived":false,"fork":false,"pushed_at":"2026-06-03T10:57:55.000Z","size":112,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-06-03T12:23:11.750Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"XSLT","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-24T19:09:53.000Z","updated_at":"2026-06-03T10:57:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"5630ed12-efec-4574-9fc3-bf401ba77561","html_url":"https://github.com/phax/ph-redact","commit_stats":null,"previous_names":["phax/ph-redact"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/phax/ph-redact","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-redact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-redact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-redact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-redact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phax","download_url":"https://codeload.github.com/phax/ph-redact/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phax%2Fph-redact/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33916320,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-04T02:00:06.755Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-04T18:00:48.401Z","updated_at":"2026-06-04T18:00:49.033Z","avatar_url":"https://github.com/phax.png","language":"XSLT","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ph-redact\n\n\u003c!-- ph-badge-start --\u003e\n[![Sonatype Central](https://maven-badges.sml.io/sonatype-central/com.helger/ph-redact-parent-pom/badge.svg)](https://maven-badges.sml.io/sonatype-central/com.helger/ph-redact-parent-pom/)\n[![javadoc](https://javadoc.io/badge2/com.helger/ph-redact/javadoc.svg)](https://javadoc.io/doc/com.helger/ph-redact)\n\n\u003e If this project saved you some time or made your day a little easier, a star would mean a lot — it helps others find it too.\n\u003c!-- ph-badge-end --\u003e\n\nXSLT-based XML document anonymizer for e-invoicing formats. Replaces all sensitive and personally identifiable data while preserving document structure, monetary values, tax information, and other non-sensitive business data.\n\nFormat detection uses the [DDD (Document Details Determinator)](https://github.com/phax/ddd) library, which also handles unwrapping of SBDH and XHE envelopes.\n\nThe creation of this repository was inspired by https://github.com/valitoolorg/zebra\n\n## Supported Formats\n\n- **UBL 2.1** - OASIS Universal Business Language (Invoice, CreditNote, Order, DespatchAdvice, and all other UBL 2.1 document types)\n- **CII D16B** - UN/CEFACT Cross Industry Invoice\n\n## What Gets Anonymized\n\n| Category | Examples | Replaced With |\n|----------|----------|---------------|\n| Party names | Company names, registration names, trading names | `Anonymous Party` |\n| Contact details | Phone, fax, email | `+00 000 0000000`, `anonymous@example.com` |\n| Person information | First/family/middle name, job title, birth date | `Anonymous Person`, `1900-01-01` |\n| Postal addresses | Street, city, postal code, region, PO box | `Anonymous Street`, `Anonymous City`, `00000` |\n| Party identifiers | Endpoint IDs, GLN, party IDs | `ANONYMIZED-PARTY-ID`, `ANONYMIZED-ENDPOINT` |\n| Tax identifiers | VAT numbers, company registration IDs | `ANONYMIZED-TAX-ID`, `ANONYMIZED-COMPANY-ID` |\n| Financial accounts | IBAN, BIC, account names | `ANONYMIZED-IBAN`, `ANONYMIZED-BIC` |\n| Payment cards | Card number, cardholder name, CVV | `0000000000000000`, `000` |\n| Document IDs | Invoice number, UUID, order/contract references | `ANONYMIZED-DOC-ID`, `ANONYMIZED-REF` |\n| Payment references | Payment IDs, mandate IDs, buyer references | `ANONYMIZED-PAYMENT-ID`, `ANONYMIZED-BUYER-REF` |\n| Notes | Free-text notes (may contain any sensitive data) | `Anonymized note` |\n| URIs | Website URLs, communication URIs | `https://www.example.com`, `ANONYMIZED-URI` |\n| Binary attachments | Embedded document content | Replaced with placeholder |\n\n## What Is Preserved\n\n- Monetary amounts (line totals, tax amounts, grand totals)\n- Tax rates and category codes\n- Currency codes\n- Country identification codes (ISO 3166)\n- Document type codes\n- Item/product names and descriptions\n- Quantities and unit codes\n- Dates (issue date, due date, delivery date)\n- UBL version and customization IDs\n- Profile and process identifiers\n- Tax scheme identifiers (e.g. `VAT`, `S`)\n\n## Usage\n\n### Command Line\n\nBuild the standalone jar and run it:\n\n```bash\nmvn clean package\njava -jar ph-redact-cli/target/ph-redact-cli-full.jar [options] \u003cfiles...\u003e\n```\n\n**Options:**\n\n| Option | Description | Default |\n|--------|-------------|---------|\n| `-t`, `--target` | Output directory | Current directory |\n| `-s`, `--suffix` | Output filename suffix | `-anonymized` |\n| `-f`, `--format` | Force format (`ubl21` or `cii-d16b`) | Auto-detect |\n| `--verbose` | Enable verbose output | Off |\n| `-h`, `--help` | Show help | |\n| `-V`, `--version` | Show version | |\n\n**Examples:**\n\n```bash\n# Anonymize a single file (format auto-detected)\njava -jar ph-redact-cli-full.jar invoice.xml\n\n# Anonymize multiple files into a specific directory\njava -jar ph-redact-cli-full.jar -t /output/dir invoice1.xml invoice2.xml cii-invoice.xml\n\n# Force CII format and use custom suffix\njava -jar ph-redact-cli-full.jar -f cii-d16b -s -redacted invoice.xml\n\n# Verbose output\njava -jar ph-redact-cli-full.jar --verbose *.xml\n```\n\nThe output file is written to the target directory with the suffix appended before the file extension.\nFor example, `invoice.xml` becomes `invoice-anonymized.xml`.\n\n### Java API\n\n```java\n// Explicit format\nXMLAnonymizer aAnonymizer = new XMLAnonymizer (EAnonymizationFormat.UBL_21);\naAnonymizer.anonymize (new File (\"invoice.xml\"), new File (\"invoice-anonymized.xml\"));\n\n// Auto-detect format (uses DDD)\nXMLAnonymizer.anonymizeAutoDetect (new File (\"input.xml\"), new File (\"output.xml\"));\n\n// DOM-based\nDocument aDoc = DOMReader.readXMLDOM (new File (\"invoice.xml\"));\nXMLAnonymizer aAnonymizer = new XMLAnonymizer (EAnonymizationFormat.CII_D16B);\nDocument aResult = aAnonymizer.anonymize (aDoc);\n```\n\n### Standalone XSLT\n\nThe XSLT stylesheets can be used independently with any XSLT 1.0 processor:\n\n```bash\n# UBL 2.1\nxsltproc ph-redact/src/main/resources/xslt/ubl21-anonymize.xslt invoice.xml \u003e invoice-anonymized.xml\n\n# CII D16B\nxsltproc ph-redact/src/main/resources/xslt/cii-d16b-anonymize.xslt cii-invoice.xml \u003e cii-invoice-anonymized.xml\n```\n\n## Project Layout\n\nThis is a multi-module Maven project:\n\n- `ph-redact` - The library: format enum, XSLT-based anonymizer, format auto-detection, and the XSLT stylesheets.\n- `ph-redact-cli` - The command-line client (picocli) and standalone fat jar build.\n\n## Building\n\nRequires Java 17+ and Maven.\n\n```bash\nmvn clean package\n```\n\nThe build produces (replacing x.y.z with the actual version number):\n- `ph-redact/target/ph-redact-x.y.z-SNAPSHOT.jar` - Library jar\n- `ph-redact-cli/target/ph-redact-cli-x.y.z-SNAPSHOT.jar` - CLI jar (lib only)\n- `ph-redact-cli/target/ph-redact-cli-full.jar` - Standalone executable jar with all dependencies\n\n## Maven Coordinates\n\nTo use the library in Maven (replacing `x.y.z` with the effective version number):\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.helger\u003c/groupId\u003e\n  \u003cartifactId\u003eph-redact\u003c/artifactId\u003e\n  \u003cversion\u003ex.y.z\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n## License\n\nApache License, Version 2.0\n\n## News and Noteworthy\n\nv1.0.1 - 2026-05-11\n* Restructured the codebase into a multi-module Maven project: `ph-redact` (library) and `ph-redact-cli` (command-line client). The library Maven coordinate `com.helger:ph-redact` is unchanged.\n* The standalone executable jar was renamed from `ph-redact-full.jar` to `ph-redact-cli-full.jar` and is now produced under `ph-redact-cli/target/`.\n\nv1.0.0 - 2026-04-24\n* Initial version\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fph-redact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphax%2Fph-redact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphax%2Fph-redact/lists"}