lightninglabs / lightning-node-connect

MIT License
78 stars 22 forks source link

mailbox: use scrypt to stretch passphrase before usage in Noise #21

Closed Roasbeef closed 2 years ago

Roasbeef commented 2 years ago

In this commit, we start to use scrypt to stretch the passphrase in order to obtain additional entropy and also mitigate brute force attacks somewhat.

Note that we do this within NewBrontideMachine as this ensures that we're able to throttle each new authentication attempt.

Thinking about this change a bit more after it was written: I think we instead just want to use HKDF to generate both the 32-byte value we use to create the point as well as the mailbox ID. Typically you use something like scrypt when you don't know the entropy of the generated password. However in our case (with the default client at least), we always generate it ourselves and know it to be high entropy.

Roasbeef commented 2 years ago

This will break compatibility though, both client and server need to update. So we'll only roll this out after the closed beta?

Yeh or during/before so then people on the beta can keep using it through the actual launch

Roasbeef commented 2 years ago

We'll also likely want to propagate the name change into the initial prologue and generator point as well.

guggero commented 2 years ago

Replaced by https://github.com/lightninglabs/lightning-node-connect/pull/23.