Important: this early version doesn't pass acceptance tests yet.
A short introduction
Noise protocol defines 24 possible handshake patterns. You need to choose one that's relevant for your requirements. For example:
- A two-message handshake in which both parties know each other's static keys.
- A three-message handshake in which both parties lack any pre-existing knowledge about each other.
- A three-message handshake in which both parties know a symmetric secret.
- A two-message handshake in which initiator knows the responder's static key.
- 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:
- ChaCha20-Poly1305 AEAD
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.