--- warning: DO NOT CHANGE THIS MANUALLY, THIS IS GENERATED BY https://github.com/duckdb/community-extensions repository, check README there title: privacy excerpt: | DuckDB Community Extensions Privacy engineering primitives: differential privacy mechanisms + budget ledger, PII/PHI masking, CN-compliant masking (GB/T 37964), MIMIC-style date shifting, k-anonymity, secrets/text redaction with reversible restore, and format-preserving encryption (FF3/FF3-1, NIST SP 800-38G) extension: name: "privacy" description: "Privacy engineering primitives: differential privacy mechanisms + budget ledger, PII/PHI masking, CN-compliant masking (GB/T 37964), MIMIC-style date shifting, k-anonymity, secrets/text redaction with reversible restore, and format-preserving encryption (FF3/FF3-1, NIST SP 800-38G)" version: "0.1.0" language: "Rust" build: "cargo" license: "MIT" excluded_platforms: "wasm_mvp;wasm_eh;wasm_threads;linux_amd64_musl;windows_amd64_rtools;windows_amd64_mingw" requires_toolchains: "rust;python3" maintainers: - "alitrack" repo: github: "alitrack/duckdb-privacy" ref: "7f3fadc89fed930c17a50c0f9eba291ee806c9e7" variegata: "7f3fadc89fed930c17a50c0f9eba291ee806c9e7" docs: hello_world: | SELECT privacy('{"op":"mask_cn","v":"13812345678"}'); extended_description: | Privacy engineering primitives for DuckDB, as a native Rust extension. Ported 1:1 from the `duckdb-luajit-libs` privacy lib. Everything is reachable through one dispatcher that mirrors the source API, plus single-argument convenience scalars: ```sql SELECT privacy('{"op":"mask_cn","v":"110101199003071234","kind":"idcard","mode":"birth"}'); SELECT privacy('{"op":"fpe_encode","v":"1234567890","key":"00000000000000000000000000000000","algo":"ff31"}'); ``` **Ops** (18): `dp_count` / `dp_sum` / `dp_mean` / `laplace` / `dp_compose` / `dp_alloc` / `dp_budget` (differential privacy + epsilon budget ledger), `mask` / `mask_cn` (PII masking, CN-compliant), `dateshift` / `dateoffset` (MIMIC-style deterministic date shifting), `kanon` (k-anonymity), `kanon_report` (l-diversity / t-closeness / suppression), `redact_text` / `redact_secrets` / `restore_text` (PHI + credential redaction with reversible restore), `fpe_encode` / `fpe_decode` / `fpe_luhn` / `fpe_token` (FF3 / FF3-1 format-preserving encryption). **Verified**: 24 unit tests; FPE checked differentially against an independent Python oracle (15 NIST FF3 + 18 FF3-1 vectors, encrypt + decrypt). extension_star_count: 0 extension_star_count_pretty: 0 extension_download_count: 81 extension_download_count_pretty: 81 image: '/images/community_extensions/social_preview/preview_community_extension_privacy.png' layout: community_extension_doc --- ### Compatibility Matrix This table covers all DuckDB releases that have not reached [end-of-life](https://duckdb.org/release_calendar), including LTS releases, and shows the 2 most recent patch releases of each. Older patch releases are not listed, but the extension may be available for them as well.
| Platform | 1.5.5 | 1.5.6 | 2.0.0 | 2.0.1 | | :--- | :---: | :---: | :---: | :---: | | Linux AMD64 | ❌ | ✅ | ❌ | ✅ | | Linux ARM64 | ❌ | ✅ | ❌ | ✅ | | macOS AMD64 | ❌ | ❌ | ❌ | ❌ | | macOS ARM64 | ❌ | ✅ | ❌ | ✅ | | Windows AMD64 | ❌ | ✅ | ❌ | ✅ | | Windows ARM64 | ❌ | ❌ | ❌ | ❌ | | WebAssembly | ❌ | ❌ | ❌ | ❌ | ### Installing and Loading ```sql INSTALL {{ page.extension.name }} FROM community; LOAD {{ page.extension.name }}; ``` {% if page.docs.hello_world %} ### Example ```sql {{ page.docs.hello_world }}``` {% endif %} {% if page.docs.extended_description %} ### About {{ page.extension.name }} {{ page.docs.extended_description }} {% endif %} ### Added Functions
| function_name | function_type | description | comment | examples | |----------------|---------------|-------------|---------|----------| | dateshift | scalar | NULL | NULL | | | dp_count | scalar | NULL | NULL | | | dp_sum | scalar | NULL | NULL | | | fpe_decode | scalar | NULL | NULL | | | fpe_encode | scalar | NULL | NULL | | | laplace | scalar | NULL | NULL | | | mask | scalar | NULL | NULL | | | mask_cn | scalar | NULL | NULL | | | privacy | scalar | NULL | NULL | | | redact_secrets | scalar | NULL | NULL | | ### Overloaded Functions
This extension does not add any function overloads. ### Added Types
This extension does not add any types. ### Added Settings
| name | description | input_type | scope | aliases | typed_value | |----------------|---------------------------------------------------------|------------|--------|---------|-------------| | temp_directory | Set the directory to which temporary files are written. | VARCHAR | GLOBAL | [] | post.db.tmp |