#authenticated-encryption #symmetric-encryption #aead #stream-cipher #poly1305 #nacl #salsa20

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

#2378 in Cryptography

Download history 29383/week @ 2024-07-30 32168/week @ 2024-08-06 26064/week @ 2024-08-13 26875/week @ 2024-08-20 25116/week @ 2024-08-27 29059/week @ 2024-09-03 27443/week @ 2024-09-10 27811/week @ 2024-09-17 30025/week @ 2024-09-24 29524/week @ 2024-10-01 34302/week @ 2024-10-08 33216/week @ 2024-10-15 41254/week @ 2024-10-22 34925/week @ 2024-10-29 29877/week @ 2024-11-05 58560/week @ 2024-11-12

171,932 downloads per month
Used in 97 crates (19 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