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, 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.2

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.2
File Size Uploaded
bauta_rs-0.1.2.tar.gz 27.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for bauta-rs 0.1.2
File
bauta_rs-0.1.2-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.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
bauta_rs-0.1.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
bauta_rs-0.1.2-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.2.tar.gz

Download URL bauta_rs-0.1.2.tar.gz
Size 27.6 kB
Tags Source
SHA-256 checksum
How to use checksums
6f753562c9e1ae5da30c9ef31bdcfd508a0e5a9f84f6ca424a94a34833feae15
BLAKE2b-256 checksum
How to use checksums
32b95c1b7220cf95c5e76e5ffd99ffcd0a10f007e1b421140ec324244b6ca03d
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

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

Download URL bauta_rs-0.1.2-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 303.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
b4f1c7454ebc4d8da19e2bf5d6263697256cd5f51a043c51cc23c188fa349ee4
BLAKE2b-256 checksum
How to use checksums
b8365937e4c3ed559231d85d78717da8bf676bd30924fb500f99db71c1a8382a
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

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

Download URL bauta_rs-0.1.2-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 294.8 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
f33fbc24f696312acf34cd3609deb95ffc4fc1f17ee8da67d3fb3da3cfa77535
BLAKE2b-256 checksum
How to use checksums
4c859c9764d93e8507f7e85677c5dead3ba5db6e3ffad09ac966c5c532994065
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

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

Download URL bauta_rs-0.1.2-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
e001bb2e0bf8cf24ce32e36a403f6ab230c56ce6442636e72983e36c20d04456
BLAKE2b-256 checksum
How to use checksums
3982479f68a9e919144e219c3d3790f21e9968551584f28ce29c6898b61a54f6
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

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

Download URL bauta_rs-0.1.2-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
bfc2c71fd0b055e4fa64061687a19702c2dc10b66f726c1f8afee2ae134b091c
BLAKE2b-256 checksum
How to use checksums
8ec395d40228cad4f0df3b1f94e34264b736586dbb952cd87161cad92134eaf6
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

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

0.1.4

5 release files

0.1.3

5 release files

This release

0.1.2 This release

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