#noise #protocol #crypto


A pure-rust implementation of the Noise Protocol Framework

49 releases

0.9.2 Mar 13, 2023
0.9.0 Feb 3, 2022
0.8.0 May 11, 2021
0.7.3 Feb 14, 2021
0.0.1-preview.10 Mar 21, 2017

#33 in Cryptography

Download history 53348/week @ 2022-11-28 45458/week @ 2022-12-05 37458/week @ 2022-12-12 29241/week @ 2022-12-19 17320/week @ 2022-12-26 26181/week @ 2023-01-02 34998/week @ 2023-01-09 37725/week @ 2023-01-16 36645/week @ 2023-01-23 35648/week @ 2023-01-30 36272/week @ 2023-02-06 42148/week @ 2023-02-13 35604/week @ 2023-02-20 38205/week @ 2023-02-27 41481/week @ 2023-03-06 46526/week @ 2023-03-13

164,815 downloads per month
Used in 203 crates (26 directly)

Apache-2.0 OR MIT

3.5K SLoC


Crates.io Docs.rs Build Status dependency status

totally official snow logo

An implementation of Trevor Perrin's Noise Protocol that is designed to be Hard To Fuck Upβ„’.

πŸ”₯ Warning πŸ”₯ This library has not received any formal audit.

What's it look like?

See examples/simple.rs for a more complete TCP client/server example.

let mut noise = snow::Builder::new("Noise_NN_25519_ChaChaPoly_BLAKE2s".parse()?)

let mut buf = [0u8; 65535];

// write first handshake message
noise.write_message(&[], &mut buf)?;

// receive response message
let incoming = receive_message_from_the_mysterious_ether();
noise.read_message(&incoming, &mut buf)?;

// complete handshake, and transition the state machine into transport mode
let mut noise = noise.into_transport_mode()?;

See the full documentation at https://docs.rs/snow.


Snow is currently tracking against Noise spec revision 34.

However, a not all features have been implemented yet (pull requests welcome):


Cryptographic providers are swappable through Builder::with_resolver(), but by default it chooses select, artisanal pure-Rust implementations (see Cargo.toml for a quick overview).

Other Providers


ring is a crypto library based off of BoringSSL and is significantly faster than most of the pure-Rust implementations.

If you enable the ring-resolver feature, Snow will include a resolvers::ring module as well as a RingAcceleratedResolver available to be used with Builder::with_resolver().

If you enable the ring-accelerated feature, Snow will default to choosing ring's crypto implementations when available.


libsodium is a fork of NaCl focused on improved usability and regular maintenance.

Compatibility caveat

libsodium blacklists a set of low-order points that it deems unsafe because they would output an all-zeroes result.

Noise does not validate Curve25519 points, so if another Noise implementation provides an all-zero (or another low-order) public key for some reason (be it testing, or a real life foot-shot), if you use the libsodium backend of snow, it will error in a way that's not fully compatible with the specification.

Resolver primitives supported

default ring libsodium
CSPRNG βœ” βœ” βœ”
25519 βœ” βœ” βœ”
AESGCM βœ” βœ”
ChaChaPoly βœ” βœ” βœ”
SHA256 βœ” βœ” βœ”
SHA512 βœ” βœ”
BLAKE2s βœ”
BLAKE2b βœ”


Licensed under either of:

at your option.


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.


~333K SLoC