rust-node-noise-handshake
Let's see if Rust and NodeJS can do a Noise handshake for authenticated, encrypted communication.
A step towards hypercore-protocol in Rust, a practical exploration of how Noise works, and a little demo of async networking in Rust with async-std.
The NodeJS part uses noise-protocol on the standard-dh branch that changes the Diffie-Hellman algorithm to follow NOISE spec].
The Rust part uses snow on a PR branch that adds the XChaChaPoly cipher.
Usage
First clone this repository and run npm install and cargo build.
Then launch the run.js script to spawn both a TCP server (responder) and a TCP client (initiator), in a combination of your choise (first is responder, second is initiator):
node run.js node nodenode run.js rust rustnode run.js node rustnode run.js rust node
Or start the sessions individually:
node handshake.js server 8000node handshake.js client 8000cargo run -- server 8000cargo run -- client 8000
Current state: It works! After long debugging I found the cause why rust/node or node/rust was not working - the nonces were padded differently.