#authenticated-encryption #aead

no-std crypto_secretbox

Pure Rust implementation of the XSalsa20Poly1305 (a.k.a. NaCl crypto_secretbox) authenticated encryption cipher as well as the libsodium variant of XChaCha20Poly1305

3 unstable releases

0.1.1 May 16, 2023
0.1.0 May 16, 2023
0.0.0 Nov 29, 2022

#2492 in Cryptography

Download history 18843/week @ 2024-07-03 21633/week @ 2024-07-10 27585/week @ 2024-07-17 27375/week @ 2024-07-24 30662/week @ 2024-07-31 31245/week @ 2024-08-07 26225/week @ 2024-08-14 26497/week @ 2024-08-21 24790/week @ 2024-08-28 29404/week @ 2024-09-04 28579/week @ 2024-09-11 27056/week @ 2024-09-18 29987/week @ 2024-09-25 30611/week @ 2024-10-02 33251/week @ 2024-10-09 35377/week @ 2024-10-16

134,695 downloads per month
Used in 89 crates (15 directly)

Apache-2.0 OR MIT

19KB
193 lines

RustCrypto: crypto_secretbox

crate Docs Apache2/MIT licensed Rust Version Project Chat Build Status

crypto_secretbox is an authenticated symmetric encryption cipher amenable to fast, constant-time implementations in software, combining either the Salsa20 stream cipher (with XSalsa20 192-bit nonce extension) or ChaCha20 stream cipher with the Poly1305 universal hash function, which acts as a message authentication code.

This algorithm has largely been replaced by the newer IETF variant of ChaCha20Poly1305 (and the associated XChaCha20Poly1305) AEAD ciphers (RFC 8439), but is useful for interoperability with legacy NaCl-based protocols.

Documentation

Security Warning

No security audits of this crate have ever been performed, and it has not been thoroughly assessed to ensure its operation is constant-time on common CPU architectures.

USE AT YOUR OWN RISK!

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.

Dependencies

~0.6–1MB
~17K SLoC