Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Demo of how to perform a Noise handshake between Rust and NodeJS
Rust JavaScript
Branch: master
Clone or download
Cannot retrieve the latest commit at this time.
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore fixes Jan 29, 2020
Cargo.toml fixes Jan 29, 2020
README.md Update README.md Jan 30, 2020
handshake.js cleanup Jan 29, 2020
package.json
run.js fixes Jan 29, 2020

README.md

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 node
  • node run.js rust rust
  • node run.js node rust
  • node run.js rust node

Or start the sessions individually:

  • node handshake.js server 8000
  • node handshake.js client 8000
  • cargo run -- server 8000
  • cargo 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.

You can’t perform that action at this time.