Problem it solves

Alice and Bob have never met. They want to have a private conversation over a network which is insecure. What they need:

Solution

  1. There is an agreed upon base key for everyone in the noise protocol
  2. They each generate their private keys, generate public keys.
  3. They share public keys
  4. Generate shared secret.

Blake 2

It derives two secret keys from the shared secret, where, A’s Incoming Key = B’s outgoing Key and vice-versa.

ChaCha20

Why do we need a nonce at all?

ChaCha uses the nonce and key to generate a keystream which is XORed with the plaintext to create a ciphertext.

<aside> 💡

Property of XOR: c1 XOR c2 gives p1 XOR p2

</aside>

That’s the reason why nonce always needs to be different.

Why not use a better algorithm?

AES-GCM was considered but: