bauta-rs
The optional native masker for Bauta.
Bauta masks data on its way from production to a copy. Masking key and
fpe columns costs tens of microseconds a value in Python, most of it spent in
the interpreter rather than in cryptography. This computes the same masks in
Rust, four to five times faster on a whole job.
It is optional. Bauta works without it, and produces identical output either way.
Installing
pip install "bauta[native]"
The extra installs the bauta-rs released with your version of bauta, which
is the only one Bauta uses; any other is ignored with a warning. Wheels cover
Linux (x86-64 and ARM) and macOS (Apple silicon and Intel) on every supported
Python. Elsewhere pip compiles it, which needs Rust 1.83 or newer.
Layout
core/ |
The constructions. No Python dependency, so they are testable without an interpreter. |
py/ |
The PyO3 layer: conversions in, results out, and every unsafe boundary. |
vectors/reference.json |
What the Python implementation produces, recorded. The contract between the two. |
generate_vectors.py |
Regenerates that file from the Python implementation. |
Building
From a clone, with Rust 1.83 or newer.
cargo test --release
cd py && maturin build --release
pip install ../target/wheels/bauta_rs-*.whl
--release matters for the tests: two of them measure SHA-256 and AES
throughput to catch a backend that has silently fallen back to software, and a
debug build is indistinguishable from one.
The rule
Python is the reference. This crate exists to be faster, not to be different. Where the two disagree, Python is right.
That is not a style preference. Bauta's masks are deterministic and keyed, so a difference between the two implementations would not surface as a wrong answer — it would surface as a changed key, months later, as joins between an old copy and a new one quietly stopping matching. The key fingerprint would not change, because the key did not.
So:
- Every covered strategy is checked against
vectors/reference.json, over a corpus chosen for boundaries rather than volume: the lengths where a Feistel half stops fitting a machine word, domains of exactly 2**128, the maximum identifier length, single-character alphabets, mixed-case hex, and every refusal with its exact message. - Anything whose behaviour depends on Python's own Unicode rules is not
reimplemented. Non-ASCII text,
str.isspace()when an address is stripped, digits normalised across scripts — those values are handed back, and Python masks them. - FF1 is checked against NIST SP 800-38G's sample vectors, and the keyed hash against RFC 4231.
What it covers
key, fpe, hash, email, digits. Everything else stays in Python:
redact needs lookbehind that Rust's regex engine doesn't offer, shuffle,
dateShift, number, keep, null and constant are already cheap, the
fake* strategies would need a second copy of the name lists, and custom
strategies are Python by definition.
Release files for bauta-rs 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bauta_rs-0.1.1.tar.gz | 27.6 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| bauta_rs-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| bauta_rs-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| bauta_rs-0.1.1-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| bauta_rs-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 1.2 MB
Release files / bauta_rs-0.1.1.tar.gz
| Download URL | bauta_rs-0.1.1.tar.gz |
|---|---|
| Size | 27.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
12e3197753eef2a2b96dc2cc3a7bd3803d0d32029e8da15dd0dd3bb154ab85a5
|
|
BLAKE2b-256 checksum How to use checksums |
7740f89ecbc390c93965af972622b801e676454032e9b448d146d88354aabfab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / bauta_rs-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | bauta_rs-0.1.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 303.3 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0d1f60b613f93331bad069cfd4f2334dd35e716b4c23c84995febc3095e6010b
|
|
BLAKE2b-256 checksum How to use checksums |
e2b92d23313613c7a28d3f4060e65628b8f8ff9dc073159e23bd5ccfb431c005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / bauta_rs-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | bauta_rs-0.1.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 294.7 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3704ecc624a9103ddec679e2c696dc2404bf000373f9ce6244b6d64d92d685b8
|
|
BLAKE2b-256 checksum How to use checksums |
17b97996c42c35c34789b64e8d321267635d252ec05a4600d0c30bd2b351d482
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / bauta_rs-0.1.1-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | bauta_rs-0.1.1-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 266.6 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7f1fd15926df8276cc6b8454541f607d36f5fe45d17efacf79d2eacaa4890e40
|
|
BLAKE2b-256 checksum How to use checksums |
a82b72a3399431568433db6468252a29c76acf6fb474faf27b76fa67046d7a93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / bauta_rs-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | bauta_rs-0.1.1-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 286.5 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
63a1ea46d72d1f716399c52bfa33fa2f23457bceab11719938f64478c2154420
|
|
BLAKE2b-256 checksum How to use checksums |
64505755ca541975005aa4607a3333729ad0bdbed106e2c4a5af8ca0bde9df9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency log