| Crates.io | korneplod |
| lib.rs | korneplod |
| version | 0.14.89 |
| created_at | 2025-05-30 19:11:27.720902+00 |
| updated_at | 2025-06-21 12:03:30.292677+00 |
| description | A library for establishing secure connections and transfer encrypted by chacha20 data between nodes. Key exchange is powered by ml-kem algorithm |
| homepage | |
| repository | https://github.com/GrigoryZhimolost/korneplod |
| max_upload_size | |
| id | 1695595 |
| size | 52,483 |
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
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.
Some features(e.g. refusing/accepting connections based on channels) will be added in further versions.
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");