Expand description
§Rust Cryptography Wrappers
This repository is parameter selection and lightweight wrapper around a number of Rust cryptographic libraries. Its purpose isn’t to implement primitives, rather to unify the API surface of existing libraries; limited to the tiny subset needed by the Dark Bio project.

- Certificates
- x509 (RFC-5280):
xDSA,xHPKE
- x509 (RFC-5280):
- Digital signatures
- Encryption
- Key derivation
- Serialization
All functionality is WASM ready.
The entire library is hidden behind feature flags to allow selectively depending on it from the firmware, cloud and mobile app, each cherry-picking only what’s needed. Please consult the docs on how to enable them.
§Siblings
This is a sibling package with the Go github.com/dark-bio/crypto-go; as in, both repositories implement the same feature sets and API surfaces at the same version points. This naturally means PRs merged into one project necessarily have to have a counter-PR in the other project.
§Acknowledgements
Shoutout to Filippo Valsorda (@filosottile) for lots of tips and nudges on what kind of cryptographic primitives to use and how to combine them properly; and also for his work in general on cryptography standards.
Naturally, many thanks to the authors of all the libraries this project depends on.
Modules§
- argon2
argon2 - Argon2id cryptography wrappers and parametrization.
- cbor
cbor - Tiny CBOR encoder and decoder.
- cose
cose - COSE wrappers for xDSA and xHPKE.
- eddsa
eddsa - EdDSA cryptography wrappers and parametrization.
- hkdf
hkdf - HKDF cryptography wrappers and parametrization.
- mldsa
mldsa - ML-DSA cryptography wrappers and parametrization.
- pem
pem - Strict PEM encoding and decoding.
- rand
rand - rsa
rsa - RSA cryptography wrappers and parametrization.
- stream
stream - I/O helper structs for age file encryption and decryption.
- x509
x509 - X.509 certificate wrappers and parametrization.
- xdsa
xdsa - Composite ML-DSA cryptography wrappers and parametrization.
- xhpke
xhpke - HPKE cryptography wrappers and parametrization.