Skip to main content

obu

PyPI Python Versions License: MIT OR Apache-2.0

Python bindings for obu — the unauthenticated / obfuscation tier of the oboron family. A string-in, string-out layer: one call takes plaintext to obtext (encrypted

  • encoded), one call brings it back.

⚠️ obu is NOT authenticated. upcbc provides confidentiality without integrity (the obtext is tamperable); zdcbc is obfuscation only and is not cryptographically secure. Never use obu to protect secrets. For real, authenticated encryption use the oboron package.

obu operates on a 32-byte secret (64 lowercase hex characters) and shares no code with the authenticated core.

Install

pip install obu

Wheels ship for CPython 3.8+ (one abi3 wheel per platform) on Linux, macOS, and Windows, plus an sdist.

Quick start

import obu

secret = obu.generate_secret()        # 64-char hex
z = obu.ZdcbcC32(secret)
obtext = z.enc("not-a-secret")
plaintext = z.dec(obtext)
assert plaintext == "not-a-secret"

Runtime-flexible (Obu, format mutable after construction):

o = obu.Obu("upcbc.b64", secret)
ot = o.enc("hello")
o.set_format("zdcbc.c32")
ot2 = o.enc("hello")

Multi-format (Omnibu, format supplied per call):

om = obu.Omnibu(secret)
ot = om.enc("hello", "upcbc.b64")
pt = om.dec(ot, "upcbc.b64")          # format supplied, not detected

The obtext is markerless — it carries no scheme prefix — so dec always needs the format the value was produced with. There is no autodetection.

Schemes

  • upcbc — unauthenticated probabilistic AES-256-CBC. Confidentiality only, with a fresh random IV per encryption (so the output differs each time). No integrity protection.
  • zdcbc — obfuscation-only deterministic AES-128-CBC with a constant IV. Not cryptographically secure, but deterministic: the same plaintext always yields the same obtext, usable as a stable handle.

Each scheme is available in four encodings — c32 (Crockford base32), b32 (RFC 4648 base32), b64 (base64url), and hex — as fixed-format classes (UpcbcC32, ZdcbcHex, …), via the runtime-format Obu, or via the multi-format Omnibu. Combine scheme and encoding as scheme.encoding, e.g. upcbc.c32. The obu.formats module exposes the format strings as constants.

Secret

obu uses a single 256-bit secret, encoded as 64 lowercase hex characters. upcbc uses all 32 bytes as the AES-256 key; zdcbc takes bytes 0–15 as the AES-128 key and bytes 16–31 as its constant IV. There is no base64 secret form. Generate one with obu.generate_secret().

Exceptions

All errors inherit from obu.ObuError:

  • InvalidSecret — bad hex secret / wrong length
  • InvalidFormat — unknown scheme / encoding / malformed format string
  • EncryptionFailed — empty plaintext / 0x01 pad-byte rejection
  • DecryptionFailed — obtext-decode / block-length / payload-shape / post-decrypt UTF-8 failure (upcbc reports a single uniform DecryptionFailed, never a distinguishing oracle)

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Metadata

Release files for obu 1.0.0

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

Source distribution (sdist)

Source distribution for obu 1.0.0
File Size Uploaded
obu-1.0.0.tar.gz 56.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for obu 1.0.0
File
obu-1.0.0-cp38-abi3-win_amd64.whl CPython 3.8 abi3 Windows x86-64 Details
obu-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details
obu-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.8 abi3 Linux glibc 2.17+ ARM64 Details
obu-1.0.0-cp38-abi3-macosx_11_0_arm64.whl CPython 3.8 abi3 macOS 11.0+ ARM64 Details
obu-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl CPython 3.8 abi3 macOS 10.12+ x86-64 Details

Total release size: 1.5 MB

Release files / obu-1.0.0.tar.gz

Download URL obu-1.0.0.tar.gz
Size 56.0 kB
Tags Source
SHA-256 checksum
How to use checksums
80c62222e6f7abf5e8a0387b2b3af62856a354f9f18bc64cae5fd7b807014d5c
BLAKE2b-256 checksum
How to use checksums
9d9f4746ce23185f67d71b8aa1754145930acbcc6b3ed8e48eb95215fd6e4eb3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 29, 2026.

Transparency log

Release files / obu-1.0.0-cp38-abi3-win_amd64.whl

Download URL obu-1.0.0-cp38-abi3-win_amd64.whl
Size 239.3 kB
Tags CPython 3.8 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
7ef6f85d7535feb1ce98a239138ed91a2dc9ac40c170a5a1be197a5ad036074e
BLAKE2b-256 checksum
How to use checksums
b58074e4f8b4cdee70338789e07732c96b9655913074a756954a6e19f66b9f6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 29, 2026.

Transparency log

Release files / obu-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL obu-1.0.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 322.0 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
bda8483b0fa90ba058dbc210f7af8151c56eb3b5d0f11dccf488673deba48cae
BLAKE2b-256 checksum
How to use checksums
d9854763adde6f4d53f9bcd114beabc5cc2b19a40df31433a8bd85dccc7a128f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 29, 2026.

Transparency log

Release files / obu-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL obu-1.0.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 300.9 kB
Tags CPython 3.8 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
ec7c41834416fd201e6317d9fe3e3bb9b0483a75d46a9d62a6a9ce5a2f73eb3a
BLAKE2b-256 checksum
How to use checksums
ba7500fd30878ffe97e5688a471ff3304f90a76b482b5ec02e3c010c09766302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 29, 2026.

Transparency log

Release files / obu-1.0.0-cp38-abi3-macosx_11_0_arm64.whl

Download URL obu-1.0.0-cp38-abi3-macosx_11_0_arm64.whl
Size 285.5 kB
Tags CPython 3.8 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
ef1d61756c61dd7b00a7a1847fea9ca13da56be7422d31e671b08bca8cdffe4d
BLAKE2b-256 checksum
How to use checksums
9ced8249af0e08b85727dcacfc577165bd4c65a9724b8fcac6eb962fdd76a2bc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 29, 2026.

Transparency log

Release files / obu-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl

Download URL obu-1.0.0-cp38-abi3-macosx_10_12_x86_64.whl
Size 308.3 kB
Tags CPython 3.8 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
0afb81164d6269863e78511b4537f8f77629a86e678aaf4e1f5b8245bb77ed03
BLAKE2b-256 checksum
How to use checksums
9b80bdf6473c3e7c4613ece9c72d5612a323947d63f2ca531fc03acfb8f52974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jun 29, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.0 This release

6 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