Noise Protocol Framework

Radikant Noise is a experimental tcp implementation of The Noise Protocol Framework to establish a “secure connection” between an initiator and responder following the various patterns outlined in the noise standard. Noise vastly simplifies the establishment of a secure channel in comparison to TLS. This implementation of noise supports primitive selection like dh-ecc, hash and cipher in runtime. Runtime primitive selection is strictly in place to facilitate testing from a single testfile. In a production environment, primitive selection should ideally occur at compile-time to avoid switch-statement overhead for the responder.
⚠️ This library is a prototype and depends on Radikant-Crypto-C and Radikant-Socket-C and therefore inherits their intrinsic security flaws. In addition this library needs to be futher hardened in area’s like; digracefull disconnects, primitive mismatches, packet-loss, timeout, malicous data etc., malformed data.
Patterns: Supports handshakes including NN, KN, NK, KK, NX, KX, XN, XK, XX, IN, IK, and IX.
The Noise Protocol Framework is inherently transport-agnostic. It can be run over transport layers such as TCP, UDP, BLE, TLS, QUIC, ESP-NOW, I2C, SPI, or, in extreme cases, even LoRa. However, TCP is often the most practical choice because it handles packet ordering and retransmission out of the box. To keep the API simple and easy to use, this implementation is tightly coupled to a TCP socket, utilizing a custom 4-byte length prefix to frame the cryptographic messages over the TCP byte stream.
If an malicous actor records all encrypted network traffic for years. They can't read it, but they just store it in a massive database. If in a later stage they manage to obtain the private keys they can retroactively decrypt all past recorded traffic. With forward security the malicous actor still cannot decrypt the past traffic.
Forward security is achieved by using ephemeral (temporary) keys for every single connection. During the handshake, both parties generate a random, temporary keypair, mix them together using Diffie-Hellman to create a unique session key, and then throw the temporary private keys away when the session is over. Because the keys used to encrypt the session were destroyed, an attacker cannot re-derive the session key even if they steal the long-term static identity keys later.
Patterns that provide Forward Security: Interactive patterns like XX, NN, NK, and KK all include the ee step in their token definitions. Once the session is over and the ephemeral keys are discarded, even the client and server cannot retroactively decrypt previous traffic.