Refactor/hybrid encryption #6
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request adds an additional cryptographic primitive (
McEliece8192128) in addition toML-KEM-1024.The reason I've picked
McEliece8192128specifically, is because it's based on a different problem that lattice-based KEMs, meaning an adversary would need to break both problems in order to retrieve the one-time-pad pad(s).I've avoided adding support for Curve448 or other classical algorithms, to keep code complexity low, and avoid near future headaches when quantum computers become strong enough to delete it and we'd have to update it. (our software will never include auto-updates, and we plan to make it federated).
Additionally, I've reworked the perfect-forward-secrecy. In previous updated, we only rotated
ML-KEM-1024keys on every 2 OTP pad batches sent, this update makes it rotate on every batch. I've also fixed some important logic issues that affected earlier versions of Coldwire.I've also simplified some parts of the logic, reducing the attack surface overall.
And last but not least, I've added fully async perfect-forward-secrecy and messaging support. Neither contacts need to be online once a KEM key rotation occurs.