Python bindings for oboron — string-in/string-out authenticated symmetric encryption + encoding (Dgcmsiv, Dsiv, Pgcmsiv, Psiv).
Project description
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 |
|---|---|---|---|
dgcmsiv |
deterministic | AES-GCM-SIV | Auth + compact + deterministic |
pgcmsiv |
probabilistic | AES-GCM-SIV | Auth + max privacy |
dsiv |
deterministic | AES-SIV | General-purpose auth, nonce-misuse safe |
psiv |
probabilistic | AES-SIV | Auth + max privacy + nonce-misuse safe |
Every oboron scheme is authenticated. For new
security-sensitive work, dsiv is a strong default.
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, no obscenity rules |
c32 |
Crockford base32 | Lowercase, obscenity-aware |
b64 |
RFC 4648 URL-safe base64 | Most compact |
hex |
Hexadecimal | Longest output, fastest 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file oboron-1.0.1.tar.gz.
File metadata
- Download URL: oboron-1.0.1.tar.gz
- Upload date:
- Size: 110.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd31114e9565af75a30cbd7187166a5918391f8e50a1387dd08bce7f2f5fc0ad
|
|
| MD5 |
5f9484aa687dbd19204f5472bfe23655
|
|
| BLAKE2b-256 |
f6c8843d0a1478540513dafa47c6a9845abc570effb44eaa92dc2b7ccaf27689
|
Provenance
The following attestation bundles were made for oboron-1.0.1.tar.gz:
Publisher:
publish-pypi.yml on deyanovich/oboron-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oboron-1.0.1.tar.gz -
Subject digest:
dd31114e9565af75a30cbd7187166a5918391f8e50a1387dd08bce7f2f5fc0ad - Sigstore transparency entry: 2003170802
- Sigstore integration time:
-
Permalink:
deyanovich/oboron-rs@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Branch / Tag:
refs/tags/py/v1.0.1 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Trigger Event:
push
-
Statement type:
File details
Details for the file oboron-1.0.1-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: oboron-1.0.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 275.5 kB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d79ea5d0d57870a5a1145269ebdbc1d6a194fdeca90fa420f6257623495b7ed9
|
|
| MD5 |
0369f9520575c26842f3a35554217472
|
|
| BLAKE2b-256 |
ba8587208924c75155a51e73692509ad577fc8972699c97fe8eb5a73420e405a
|
Provenance
The following attestation bundles were made for oboron-1.0.1-cp38-abi3-win_amd64.whl:
Publisher:
publish-pypi.yml on deyanovich/oboron-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oboron-1.0.1-cp38-abi3-win_amd64.whl -
Subject digest:
d79ea5d0d57870a5a1145269ebdbc1d6a194fdeca90fa420f6257623495b7ed9 - Sigstore transparency entry: 2003171023
- Sigstore integration time:
-
Permalink:
deyanovich/oboron-rs@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Branch / Tag:
refs/tags/py/v1.0.1 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Trigger Event:
push
-
Statement type:
File details
Details for the file oboron-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: oboron-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 351.3 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
13bcd98cf0b442694d0ddf2a8e74f21350d074f468e121fd873c750e71ae3b98
|
|
| MD5 |
da9873afd6335526ce7163dd15236dbf
|
|
| BLAKE2b-256 |
83f385f91d1a0e89ef8f1113de5e36f705913ea14a2d60b4359f5d3d34c9ebd6
|
Provenance
The following attestation bundles were made for oboron-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
publish-pypi.yml on deyanovich/oboron-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oboron-1.0.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
13bcd98cf0b442694d0ddf2a8e74f21350d074f468e121fd873c750e71ae3b98 - Sigstore transparency entry: 2003170983
- Sigstore integration time:
-
Permalink:
deyanovich/oboron-rs@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Branch / Tag:
refs/tags/py/v1.0.1 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Trigger Event:
push
-
Statement type:
File details
Details for the file oboron-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: oboron-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 331.5 kB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
294d8e3457a90c86d9aedec2b7056f1031f58c88fd374081b8303293861a06a7
|
|
| MD5 |
0995bdd571f9ccddea257dc502da3a88
|
|
| BLAKE2b-256 |
b6e70d9417a1b7a0e6eac1fb0c9cd34f3ca550837178652b9542d9eabba062ea
|
Provenance
The following attestation bundles were made for oboron-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
publish-pypi.yml on deyanovich/oboron-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oboron-1.0.1-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
294d8e3457a90c86d9aedec2b7056f1031f58c88fd374081b8303293861a06a7 - Sigstore transparency entry: 2003171075
- Sigstore integration time:
-
Permalink:
deyanovich/oboron-rs@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Branch / Tag:
refs/tags/py/v1.0.1 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Trigger Event:
push
-
Statement type:
File details
Details for the file oboron-1.0.1-cp38-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: oboron-1.0.1-cp38-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 315.8 kB
- Tags: CPython 3.8+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7a7e5358d2c86963fed3959e50b443dd041b95578c5ac2a8b34981ceee061ea
|
|
| MD5 |
c57832f22d514d92a7346fcd7baf18c5
|
|
| BLAKE2b-256 |
4e7019ff3996c179bd60e43823edc9027f6efe41b0f8ad780e9a2d4125474bbd
|
Provenance
The following attestation bundles were made for oboron-1.0.1-cp38-abi3-macosx_11_0_arm64.whl:
Publisher:
publish-pypi.yml on deyanovich/oboron-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oboron-1.0.1-cp38-abi3-macosx_11_0_arm64.whl -
Subject digest:
b7a7e5358d2c86963fed3959e50b443dd041b95578c5ac2a8b34981ceee061ea - Sigstore transparency entry: 2003170909
- Sigstore integration time:
-
Permalink:
deyanovich/oboron-rs@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Branch / Tag:
refs/tags/py/v1.0.1 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Trigger Event:
push
-
Statement type:
File details
Details for the file oboron-1.0.1-cp38-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: oboron-1.0.1-cp38-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 337.5 kB
- Tags: CPython 3.8+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aa661c6f1a664978ddb9a7a350cb2c494a99ef015a749a8820ac10b293d93843
|
|
| MD5 |
3d93fc9042770a399456918477340a30
|
|
| BLAKE2b-256 |
56a6410048975b37523b484364fb4e2d188ddeb4824815f121b96f69a5320054
|
Provenance
The following attestation bundles were made for oboron-1.0.1-cp38-abi3-macosx_10_12_x86_64.whl:
Publisher:
publish-pypi.yml on deyanovich/oboron-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
oboron-1.0.1-cp38-abi3-macosx_10_12_x86_64.whl -
Subject digest:
aa661c6f1a664978ddb9a7a350cb2c494a99ef015a749a8820ac10b293d93843 - Sigstore transparency entry: 2003170855
- Sigstore integration time:
-
Permalink:
deyanovich/oboron-rs@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Branch / Tag:
refs/tags/py/v1.0.1 - Owner: https://github.com/deyanovich
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@b8aaf9c17d35c66799d76e8050c2db34b9379803 -
Trigger Event:
push
-
Statement type: