12 releases (4 stable)
1.2.1 | Sep 15, 2020 |
---|---|
1.1.0 | Sep 10, 2020 |
0.5.1 | Sep 8, 2020 |
0.4.1 | Sep 1, 2020 |
0.1.0 | Aug 21, 2020 |
#10 in #256-bit
43 downloads per month
Used in sfshr
61KB
1.5K
SLoC
simpletcp
Crate for simple and secure TCP communication
Encryption
All traffic is encrypted with 256-bit AES-CBC
Initialization
- Server generates RSA key and sends it to client
- Client generates AES key, encrypts it with server key and send it to the server
- 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
Dependencies
~2.9–6MB
~116K SLoC