#aead #poly1305 #stream-cipher #nacl #salsa20 #xsalsa20

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

#2334 in Cryptography

Download history 8217/week @ 2023-12-13 7243/week @ 2023-12-20 4849/week @ 2023-12-27 7998/week @ 2024-01-03 8406/week @ 2024-01-10 9816/week @ 2024-01-17 10035/week @ 2024-01-24 9876/week @ 2024-01-31 9479/week @ 2024-02-07 10291/week @ 2024-02-14 10706/week @ 2024-02-21 15324/week @ 2024-02-28 16029/week @ 2024-03-06 14315/week @ 2024-03-13 14637/week @ 2024-03-20 9565/week @ 2024-03-27

57,762 downloads per month
Used in 42 crates (13 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–0.9MB
~16K SLoC