Skip to main content

colgov

Deterministic, reversible tokenization and fail-closed access policy for tabular PII.

Tokenize a column and it stays joinable. Same plaintext, same token — every time, across tables and across runs — so JOIN, GROUP BY and COUNT(DISTINCT) keep working on data nobody can read.

Status: placeholder. Version 0.0.1 reserves the name while the first release is built. There is no working API yet. Watch the repository for v0.1.0.

The problem

Encrypting a column normally destroys its analytical value. Standard authenticated encryption uses a random IV, so the same email address becomes different ciphertext every time it is encrypted — correct for protecting text, useless for a warehouse:

encrypt("ada@example.com")   # 'Yk2p...'
encrypt("ada@example.com")   # 'Qm9x...'  ← different every call

Join two tables on that column and you get zero rows back.

The approach

colgov uses AES-SIV (RFC 5297), a deterministic authenticated encryption mode. The same input always produces the same token, and the original value is recoverable with the key:

tokenize("ada@example.com")   # 'Ik9dLm2pQx7vRn4tYw8sBa=='
tokenize("ada@example.com")   # 'Ik9dLm2pQx7vRn4tYw8sBa=='  ← stable

Determinism is a deliberate trade, not a free win: it preserves the frequency distribution of a column, so low-cardinality fields stay re-identifiable even once tokenized. colgov treats that as a first-class concern and refuses, by default, to tokenize columns whose cardinality is too low to protect.

Planned for v0.1

  • Deterministic reversible tokenization with per-column key derivation (HKDF)
  • Column classification from portable YAML rule packs
  • Human review workflow — a machine suggests, a person decides
  • Fail-closed policy resolution: an unclassified column is never visible
  • Re-identification risk scoring (cardinality, k-anonymity)

Scope

colgov governs columns in tabular data. It does not detect PII inside free-text prose — for that, use Presidio, which is excellent at it. An optional bridge is planned so Presidio can act as a value-shape detector feeding colgov's classification.

License

Apache-2.0

Release files for colgov 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colgov 0.0.1
File Size Uploaded
colgov-0.0.1.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colgov 0.0.1
File Interpreter ABI Platform
colgov-0.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 13.0 kB

Release files / colgov-0.0.1.tar.gz

Download URL colgov-0.0.1.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ae91e07980149d59f90f94d40fd87a9c847d3916d51883056ff8880059dd5b05
BLAKE2b-256 checksum
How to use checksums
c9f84b1751f6e18f30696fb58f40bec03faa16122996eac4485358d27b205398
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release files / colgov-0.0.1-py3-none-any.whl

Download URL colgov-0.0.1-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dc6b03adbfbe4a9572cd2aa5e2bf206b1ecff6047988624f16e8b23c2477c45d
BLAKE2b-256 checksum
How to use checksums
60b27368d6badde87491e24c4be7b0c3091e08a9e2d86bc14a29560c52175c3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.10

Release history Release notifications | RSS feed

1.0.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

This release

0.0.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page