Skip to main content

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, seven to nine times faster on a whole job on one core, and can use several.

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

Path What it is
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. cargo test covers core/; py/ needs a Python interpreter to link, so it is tested from Python, by tests/test_nativeMasking.py.

Threads, and remembering masks

A chunk's distinct values are masked across a thread pool, whose size the Python layer sets per process (setThreads) from jobs.yaml's maskingThreads; each mask depends on its value alone, so the count changes no result. availableCores() reads a container's CPU quota, which Python's os.cpu_count() doesn't. key, fpe and the fake* strategies also remember masks across chunks. The extension allocates through mimalloc: the system allocators serialise masking's many small allocations across threads.

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, and the fake* strategies, which pick from the lists Python passes in when a masker is built -- so the lists are defined once, in Python, and the vectors record them. 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, and custom strategies are Python by definition.

Release files for bauta-rs 0.1.4

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

Source distribution (sdist)

Source distribution for bauta-rs 0.1.4
File Size Uploaded
bauta_rs-0.1.4.tar.gz 33.2 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bauta-rs 0.1.4
File
bauta_rs-0.1.4-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.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
bauta_rs-0.1.4-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
bauta_rs-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 1.7 MB

Release files / bauta_rs-0.1.4.tar.gz

Download URL bauta_rs-0.1.4.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
27fba748a8ddb4a8250d4b733d0d50dfe3b7e88cc55bf4c97d96cf0a092c18ff
BLAKE2b-256 checksum
How to use checksums
f72ca8cedc78717cc8df08b4ff47856b378b98d14786fb63d94c588c19ea0df0
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 19, 2026.

Transparency log

Release files / bauta_rs-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bauta_rs-0.1.4-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 433.0 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
46fc0fa0092b8c3a3f6573317e82a3fcc09ed679d0c12f2d2659946acc4b3717
BLAKE2b-256 checksum
How to use checksums
8eaa7b8e94de4a3c47be40056a7ce370edad26cb160ecadf4f7bfe81954a1dca
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 19, 2026.

Transparency log

Release files / bauta_rs-0.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL bauta_rs-0.1.4-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 424.9 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
82da53a7c8a167363e97035f5e879598d25d0a589f5a615d3ecfdb1863019a38
BLAKE2b-256 checksum
How to use checksums
5f080697fd9a8e8b3f1c82506cb390cd7a4143acb8e61b3a8d19edd5bd6f7981
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 19, 2026.

Transparency log

Release files / bauta_rs-0.1.4-cp310-abi3-macosx_11_0_arm64.whl

Download URL bauta_rs-0.1.4-cp310-abi3-macosx_11_0_arm64.whl
Size 370.2 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
aa70824e901582aea91d9c81efa4faabc8e83b52afc7839cee15a955c7dc45e3
BLAKE2b-256 checksum
How to use checksums
238519eb1a1909f99fa792c4e0cfbea09bbc0f1da14628a497ffcbfef6cca918
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 19, 2026.

Transparency log

Release files / bauta_rs-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl

Download URL bauta_rs-0.1.4-cp310-abi3-macosx_10_12_x86_64.whl
Size 398.2 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
73c0930c48e54d4bf004fcde308d0047abf4a245e245c903e41a0a10f5e5fba2
BLAKE2b-256 checksum
How to use checksums
ab3e40c6eee80e138da617e2e37e0bf9447b23091f680eb145b1b7ed3113c5be
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 19, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.2

5 release files

0.2.1

5 release files

0.2.0

5 release files

0.1.9

5 release files

0.1.8

5 release files

0.1.7

5 release files

0.1.6

5 release files

0.1.5

5 release files

This release

0.1.4 This release

5 release files

0.1.3

5 release files

0.1.2

5 release files

0.1.1

5 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