17 releases

0.17.7 Sep 10, 2024
0.17.6 Sep 19, 2023
0.17.5 Jul 4, 2023
0.17.4 Mar 4, 2023
0.1.42 Mar 20, 2018

#21 in Cryptography

Download history 36322/week @ 2024-08-15 35161/week @ 2024-08-22 36166/week @ 2024-08-29 42023/week @ 2024-09-05 41556/week @ 2024-09-12 194205/week @ 2024-09-19 202714/week @ 2024-09-26 587225/week @ 2024-10-03 533166/week @ 2024-10-10 534296/week @ 2024-10-17 79869/week @ 2024-10-24 45854/week @ 2024-10-31 43515/week @ 2024-11-07 43856/week @ 2024-11-14 43661/week @ 2024-11-21 37334/week @ 2024-11-28

175,828 downloads per month
Used in 49 crates (17 directly)

MIT license

1MB
15K SLoC

orion

Tests Daily tests dudect Audit codecov Documentation Crates.io Safety Dance MSRV Matrix

About

Orion is a cryptography library written in pure Rust. It aims to provide easy and usable crypto while trying to minimize the use of unsafe code. You can read more about Orion in the wiki.

Currently supports:

  • AEAD: (X)ChaCha20-Poly1305.
  • Hashing: BLAKE2b, SHA2, SHA3.
  • XOF: SHAKE128, SHAKE256.
  • KDF: HKDF, PBKDF2, Argon2i.
  • Key exchange: X25519.
  • MAC: HMAC, Poly1305.
  • Stream ciphers: (X)ChaCha20.
  • KEM: DHKEM(X25519, HKDF-SHA256).

Experimental support (with experimental feature enabled):

  • Committing AEAD: (X)ChaCha20-Poly1305-BLAKE2b.

Security

This library has not undergone any third-party security audit. Usage is at own risk.

Orion uses formally verified arithmetic, generated by Fiat Crypto, for the X25519 and Poly1305 implementations.

See the SECURITY.md regarding recommendations on correct use, reporting security issues and more. Additional information about security regarding Orion is available in the wiki.

Minimum Supported Rust Version

Rust 1.80 or later is supported however, the majority of testing happens with latest stable Rust.

MSRV may be changed at any point and will not be considered a SemVer breaking change.

Crate Features

  • default/safe_api: All functionality, requires std.
  • serde: Requires either alloc or default/safe_api.
  • alloc: Argon2i in hazardous when default/safe_api is not available.
  • no_std: Implicit feature that represents no heap allocations. Enabled by disabling default features and not selecting any additional features.
  • experimental: These APIs may contain breaking changes in any non SemVer-breaking crate releases.

More detailed explanation of the features in the wiki.

Documentation

Can be viewed here or built with:

RUSTDOCFLAGS='--cfg docsrs' cargo +nightly doc --no-deps --all-features

Tests and Fuzzing

The wiki has details on how Orion is tested. To run all tests:

cargo test

Fuzzing is done using honggfuzz-rs in orion-fuzz. See orion-fuzz on how to start fuzzing Orion.

Constant-time execution tests can be found at orion-dudect and orion-sidefuzz.

Benchmarks

An overview of the performance that can be expected from Orion can be seen here.

The library can be benchmarked with Criterion as below. All benchmarking tests are located in benches/.

cargo bench

Changelog

Please refer to the CHANGELOG.md list.

Contributing

Please refer to the guidelines in CONTRIBUTING.md for information on how to contribute to Orion.

License

Orion is licensed under the MIT license. See the LICENSE file for more information.

Dependencies

~4MB
~83K SLoC