noise_protocol 0.1.1 noise_protocol: ^0.1.1 copied to clipboard
A Dart implementation of Noise protocol, which can be used for securing communications (E2EE, etc.).
Overview #
Noise framework is a secure handshake protocol, which has been analyzed by professional cryptographers. It has been adopted by products/companies such as WhatsApp (whitepaper) and Slack (blog post).
Important: this early version doesn't pass acceptance tests yet.
Links #
A short introduction #
Noise protocol defines 24 possible handshake patterns. You need to choose one that's relevant for your requirements. For example:
- KK
- A two-message handshake in which both parties know each other's static keys.
- XX
- A three-message handshake in which both parties lack any pre-existing knowledge about each other.
- XXpsk3
- A three-message handshake in which both parties know a symmetric secret.
- IK
- A two-message handshake in which initiator knows the responder's static key.
- N
- A one-message handshake in which initiator knows the responder's static key. Suitable for use cases such as file encryption.
You also need to choose a key exchange algorithm, a cipher, and a hash algorithm. This implementation supports:
- Key exchange algorithms:
- X25519
- Ciphers:
- AES-GCM
- ChaCha20-Poly1305 AEAD
- Hashes:
- BLAKE2s
- SHA2-256
Please remember that you also need to use of prologue and/or payload to prevent replay attacks and identity probing.
The output of a Noise handshake is two symmetric encryption keys: one for encrypting, one for decrypting.
Please read more at noiseprotocol.org.