twopoint
Encrypted UDP messaging between two endpoints using AES-128-GCM.
Usage
use ;
// create encryption key from hex string
// use $ openssl rand -hex 16
let key: Key = "371fa32e478d65c7d91b7cc431d813af".parse?;
// create two peers
let peer1 = setup?;
let peer2 = setup?;
// connect peers to each other
peer1.connect?;
peer2.connect?;
// send encrypted message
let mut message = b"hello world".to_vec;
peer1.send?;
// receive and decrypt message (buffer must be large enough)
let mut buffer = vec!;
peer2.recv?;
Security
The encryption implementation was created without formal cryptography experience, though I believe it is generally sound. I use AES-128-GCM with ChaCha8 CSPRNG generated nonces where reuse is theoretically possible after ~2^96 nonces. You probably shouldn't put this into production.
Authors
Made with ❤ by Lua (foxgirl.dev)
License
This crate is licensed under the MIT License.