#encryption #post-quantum-cryptography #async #key-exchange #ml-kem #chacha20 #quantum-safe #data #server #send

yanked korneplod

A library for establishing secure connections and transfer encrypted by chacha20 data between nodes. Key exchange is powered by ml-kem algorithm

Uses new Rust 2024

0.14.89 Jun 21, 2025
0.14.88 May 30, 2025

#4 in #quantum-safe

Download history 122/week @ 2025-05-28 101/week @ 2025-06-18 10/week @ 2025-06-25

116 downloads per month

GPL-3.0 license

27KB
461 lines

Pls dont use it for now

i found some bugs with passwords but dont have enough time to fix. In addition to some performance issues, all 1.x versions shall be awesome when i release them

What is this

This library is for transfering encrypted data through TCP/IP, just for this. It uses ml-kem and ChaCha20 to encrypt data, so you don't have to worry about your data's safety.

Features

  • data's encrypted with ChaCha20
  • key and nonce exchange is proceeded with ml-kem in 1024-bit mode
  • it's completely asynchronous

Some features(e.g. refusing/accepting connections based on channels) will be added in further versions.

How to use this

Here are basic usage examples below:

server

use korneplod::server::Server;
use korneplod::tools::sockaddr_from;
use korneplod::Message;
//Binding server
let mut server = Server::new( sockaddr_from("127.0.0.1", 1448, false).unwrap() ).await?;

//listening and handshaking an incoming connection
let mut client = server.listen_handshaked(true, Some([78u8; 32])).await.unwrap();

//Creating a message to send
let message = Message::new("new message".as_bytes().to_vec(), 0);

//Sending the message
client.send_message(&message).await?;

client

use korneplod::client::Client;
use korneplod::tools::sockaddr_from;

//Connecting to listener
let mut client = Client::connect( sockaddr_from("127.0.0.1", 1448, false).unwrap() ).await?;

//Performing handshaking
client.handshake(Some([78u8; 32])).await?;

//Getting a message
let message = client.get_message().await?;

assert_eq!(String::from_utf8(message.get_content_vec()).unwrap(), "new message");

Dependencies

~7–16MB
~222K SLoC