simpletcp

Crates.iosimpletcp
lib.rssimpletcp
version1.2.1
sourcesrc
created_at2020-08-21 16:03:40.276584
updated_at2020-09-15 20:41:30.378388
descriptionCrate for simple and secure tcp communication
homepage
repositoryhttps://github.com/ondralukes/simpletcp
max_upload_size
id279254
size83,041
(ondralukes)

documentation

README

simpletcp

Crate for simple and secure TCP communication

Encryption

All traffic is encrypted with 256-bit AES-CBC

Initialization

  1. Server generates RSA key and sends it to client
  2. Client generates AES key, encrypts it with server key and send it to the server
  3. From now, all communication is encrypted with 256-bit AES in CBC mode

Usage

//Connect
let mut client = TcpStream::connect("127.0.0.1:4234").unwrap();

//Wait until connection is initialized
client.wait_until_ready().unwrap();

//Build message
let mut msg = Message::new();
msg.write_f64(1.23455);
msg.write_buffer(&[3, 1, 4, 56]);

//Send message
client.write(&msg).unwrap();

See examples

Commit count: 40

cargo fmt