enoise/README.md
Hans Svensson 2b5f08e156 Ditch enacl, support DH448 and Blake2s, and fix types (#14)
* Remove get_stacktrace (deprecated since OTP-24)

* Add DH448 support and switch to crypto:generate_key for DH25519

* Switch to crypto:hash/2 for Blake2b and support Blake2s

* Switch last enacl calls to crypto - no more enacl

* Eqwalizer fixes

Ewqalizer fix

Eqwalizer fix

Eqwalizer fix

Eqwalizer fix

Eqwalizer support

Eqwalizer fix

Fix tests to follow types (remote keys)

* More error handling on setup

* Dialyzer fix

* Write CHANGELOG

* Note about type-checking in README
2025-03-30 05:02:35 +09:00

1.3 KiB

enoise

An Erlang implementation of the Noise protocol

enoise provides a generic handshake mechanism, that can be used in a couple of different ways. There is also a plain gen_tcp-wrapper, where you can "upgrade" a TCP socket to a Noise socket and use it in much the same way as you would use gen_tcp.

Interactive handshake

When using enoise to do an interactive handshake, enoise will only take care of message composition/decompositiona and encryption/decryption - i.e. the user has to do the actual sending and receiving.

An example of the interactive handshake can be seen in the noise_interactive test in test/enoise_tests.erl.

Generic handshake

There is also the option to use an automated handshake procedure. If provided with a generic Communication state that describe how data is sent and received, the handshake procedure is done automatically. The result of a successful handshake is two Cipher states that can be used to encrypt/decrypt a RX channel and a TX channel respectively.

The provided gen_tcp-wrapper is implemented using the generic handshake, see src/enoise.erl.

Build

$ rebar3 compile

Test

$ rebar3 eunit

Typecheck

$ rebar3 dialyzer
$ elp --eqwalize-all --rebar