feat(wsserver): E2E PAKE handshake — X25519 ECDH + AES-256-GCM - #102
Open
blaspat wants to merge 3 commits into
Open
feat(wsserver): E2E PAKE handshake — X25519 ECDH + AES-256-GCM#102blaspat wants to merge 3 commits into
blaspat wants to merge 3 commits into
Conversation
The Test job in release.yml was failing because HERMES_NODES_TOKEN_KEY is required by the internal auth token system but was not set in CI. Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Server-side counterpart to Go client E2E handshake: - New e2e.py: X25519 keygen, ECDH, HKDF-SHA256 key derivation, HMAC proof verification, AES-256-GCM encrypt/decrypt - server.py: ECDH exchange in hello_ack, proof verification in auth, session key derivation after auth_ok - Encrypted send/receive wrappers in message dispatch loop - Ping/pong responses encrypted via local _send wrapper - Old clients without e2e flag fall back to plaintext auth - All 14 existing tests still pass Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
Add End-to-End Encryption section: token never on wire, forward secrecy, MITM resistance, backward compatibility. Link to full e2e-spec.md. Signed-off-by: Blasius Patrick <blasius.patrick@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Server-side counterpart to the Go client E2E handshake. Implements the full PAKE-style handshake: X25519 ECDH → HKDF with pairing token → HMAC mutual auth → AES-256-GCM encryption for all operational messages.
Changes
wsserver/e2e.py(new) — X25519 keygen, ECDH, HKDF-SHA256 key derivation, HMAC proof generation/verification, AES-256-GCM encrypt/decryptwsserver/server.py— ECDH exchange inhello_ack, proof verification inauth, session key derivation afterauth_ok. Encrypted send/receive wrappers in message dispatch loop. Ping/pong responses encrypted via local_sendwrapper. Old clients withoute2eflag fall back to plaintext authdocs/e2e-spec.md(new) — Full protocol specification: handshake flow, cryptographic primitives, message structures, error codes, MITM/replay analysisREADME.md— Document E2E encryption with security properties table.github/workflows/release.yml— Fernet key for release workflowSecurity properties
auth_err(4001)e2e: truefall back to legacy plaintext authTest plan
All 14 existing tests still pass. The handshake is backward compatible — old clients without
e2e: truenegotiate plaintext auth.