oboron
Python bindings for oboron — a string-in,
string-out symmetric encryption and encoding library. One call
takes plaintext to obtext (encrypted + encoded), one call
brings it back. Multiple authenticated AES-based schemes
(deterministic and probabilistic) share a single key and a
uniform API.
For the bytes-in/bytes-out cryptographic core (no encoding, no
UTF-8 validation), see obcrypt-py. oboron-py
layers encoding and format strings on top.
Install
pip install oboron
Wheels are published for Linux (x86_64, aarch64), macOS (arm64,
x86_64), and Windows (x86_64). The extension is built against
PyO3's stable ABI (abi3-py38); a single wheel per platform
covers CPython 3.8 and later.
Keys
Keys are 128-character hex strings — the canonical oboron key form, the same form that comes out of env vars, config files, and secrets managers. Generate one:
import oboron
key = oboron.generate_key()
# 'b5129efd1cf34b0c7a83...' (128 lowercase hex chars)
Wherever oboron takes a key, it takes that string directly.
Raw 64-byte key material is available via the key_bytes
property and generate_key_bytes() for interop with byte-native
APIs (HSMs, cryptography, pynacl, custom storage), but hex
is the canonical input everywhere.
Quick start
Fixed-format codec (most common)
import oboron
key = oboron.generate_key()
ob = oboron.DsivC32(key)
obtext = ob.enc("hello, world")
plaintext = ob.dec(obtext)
assert plaintext == "hello, world"
DsivC32 binds a key + the dsiv.c32 format together — most
ergonomic when one codec handles many messages of the same
format. Available classes follow the {Scheme}{Encoding}
pattern: DgcmsivB64, DsivHex, PsivC32, PgcmsivB32, etc.
Or, from an env var:
import os, oboron
ob = oboron.DsivC32(os.environ["OBORON_KEY"])
Runtime-flexible (Ob)
When the format is chosen at runtime (config, user input), use
Ob — same shape, but set_format / set_scheme /
set_encoding mutate the format in place.
ob = oboron.Ob("dsiv.b64", key)
obtext = ob.enc("hello")
ob.set_encoding("c32") # now dsiv.c32
ob.set_scheme("dgcmsiv") # now dgcmsiv.c32
ob.set_format("psiv.hex") # now psiv.hex
Multi-format (Omnib)
Omnib doesn't store a format — pass one per call.
omb = oboron.Omnib(key)
ot_dsiv = omb.enc("hello", "dsiv.b64")
ot_dgcmsiv = omb.enc("hello", "dgcmsiv.c32")
assert omb.dec(ot_dsiv, "dsiv.b64") == "hello"
assert omb.dec(ot_dgcmsiv, "dgcmsiv.c32") == "hello"
Free functions
For one-off operations without instantiating a codec:
import oboron
from oboron import formats
key = oboron.generate_key()
obtext = oboron.enc("hello", formats.DSIV_B64, key)
plaintext = oboron.dec(obtext, formats.DSIV_B64, key)
Schemes
| Name | Determinism | Algorithm | Use case |
|---|---|---|---|
dsiv |
deterministic | AES-SIV | General-purpose auth, nonce-misuse safe |
psiv |
probabilistic | AES-SIV | Auth + max privacy + nonce-misuse safe |
dgcmsiv |
deterministic | AES-GCM-SIV | Auth + compact + deterministic |
pgcmsiv |
probabilistic | AES-GCM-SIV | Auth + max privacy |
Every oboron scheme is authenticated. In general, AES-SIV and AES-GCM-SIV have similar properties, with AES-SIV being typically more performant on short inputs, while AES-GCM-SIV scales better with input size, and outperforms AES-SIV on long inputs.
The unauthenticated (upcbc) and obfuscation (zdcbc) layers
live in the separate obu
crate, not these bindings.
Encodings
| Encoding | Description | Notes |
|---|---|---|
b32 |
RFC 4648 base32 | Uppercase |
c32 |
Crockford base32 | Lowercase (obscenity safe) |
b64 |
RFC 4648 URL-safe base64 | Most compact |
hex |
Hexadecimal | Longest output (slightly faster decode) |
Format = scheme.encoding, e.g. dsiv.c32, dgcmsiv.b64,
psiv.hex. The oboron.formats module exposes every valid
combination as a constant: formats.DSIV_C32,
formats.DGCMSIV_B64, etc. — useful for typo-resistance and
editor autocomplete.
Exceptions
All errors inherit from oboron.OboronError:
InvalidKey— bad hex / wrong-length keyInvalidFormat— unknown scheme, unknown encoding, malformed format stringEncryptionFailed— AEAD failure / empty plaintextDecryptionFailed— tag check, obtext-decode failure, post-decrypt UTF-8 validation
try:
ob = oboron.DsivC32("not-a-real-key")
except oboron.InvalidKey as e:
...
Inheritance / isinstance
All codec classes plus Ob are registered as virtual
subclasses of oboron.OboronBase. Useful for generic code:
def encrypt_each(cipher: oboron.OboronBase, items: list[str]) -> list[str]:
return [cipher.enc(item) for item in items]
Keyless mode
Every codec accepts keyless=True instead of a key — it
substitutes a publicly hardcoded key. This is for testing and
obfuscation contexts where you actively want the output to be
recoverable without secret material. Never use keyless=True
when confidentiality matters.
ob = oboron.DgcmsivB64(keyless=True)
Development build
pip install maturin
cd oboron-py
maturin develop --release
python -m oboron.test_inheritance
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
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 oboron 1.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| oboron-1.0.2.tar.gz | 111.3 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| oboron-1.0.2-cp38-abi3-win_amd64.whl | CPython 3.8 | abi3 | Windows x86-64 | Details |
| oboron-1.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| oboron-1.0.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.8 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| oboron-1.0.2-cp38-abi3-macosx_11_0_arm64.whl | CPython 3.8 | abi3 | macOS 11.0+ ARM64 | Details |
| oboron-1.0.2-cp38-abi3-macosx_10_12_x86_64.whl | CPython 3.8 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 1.7 MB
Release files / oboron-1.0.2.tar.gz
| Download URL | oboron-1.0.2.tar.gz |
|---|---|
| Size | 111.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa1490d6e0fd5fbfbf24ac7e3bfcf0a868e585b432b4165e9e077189af2742d3
|
|
BLAKE2b-256 checksum How to use checksums |
4a8d9d6f516363210db4d90904d317c158866314857884d51f83d3e1211e3ffb
|
| 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 logRelease files / oboron-1.0.2-cp38-abi3-win_amd64.whl
| Download URL | oboron-1.0.2-cp38-abi3-win_amd64.whl |
|---|---|
| Size | 275.4 kB |
| Tags | CPython 3.8 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
e1718c84b21590f400b1b90890d59d679a312d9972f729b3cf55d365a1785fff
|
|
BLAKE2b-256 checksum How to use checksums |
8ab8c9b5a3844f1e3df484cf272bd4d4ac3b724bb87d679cb32387c32ef9a228
|
| 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 logRelease files / oboron-1.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | oboron-1.0.2-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 351.4 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
58129d67d04787c5e6319a66b2cbf1886b2949299cbbfb3e74d76b7cd357663d
|
|
BLAKE2b-256 checksum How to use checksums |
f31ce58cee699d734484415a97d590f96bfcf131dc2648e7f1031b244591b920
|
| 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 logRelease files / oboron-1.0.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | oboron-1.0.2-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 332.2 kB |
| Tags | CPython 3.8 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5d7e5f408d5dea89797de6a88c9e7107d57dad8e2e7e10c48d5af852082d2ee6
|
|
BLAKE2b-256 checksum How to use checksums |
ffdab01d6fc1cccfae5acafef9003f79b9b5e357c12708dd6df6c0bbbb150a35
|
| 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 logRelease files / oboron-1.0.2-cp38-abi3-macosx_11_0_arm64.whl
| Download URL | oboron-1.0.2-cp38-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 315.9 kB |
| Tags | CPython 3.8 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
02543a2412c8c26ac9d81b310141c6fe465cb172c05b70dacd5a852d8a745f2a
|
|
BLAKE2b-256 checksum How to use checksums |
83e887f10eed82d24e2d48c6aca47328e7d4d8110bbd928d4e49fa2763e65d90
|
| 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 logRelease files / oboron-1.0.2-cp38-abi3-macosx_10_12_x86_64.whl
| Download URL | oboron-1.0.2-cp38-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 337.3 kB |
| Tags | CPython 3.8 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
b6cdd36d8f6dede82d6e7cf623bb650f5eb94353e034fa838bdba5e9614204e4
|
|
BLAKE2b-256 checksum How to use checksums |
c11ecadb037ebc10cf0703f7fe144fc5822688d40e66091d11ea519cfd84ee5e
|
| 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