This is a project made in Rust to try and understand the basics of asymmetric encryption, practice Rust and use sockets.
- Implement local network messaging using sockets and threads
- Add server ip address as a parameter
- Add RSA encryption for the messages
- Improve the terminal interface
- Remove disconnect crash
For each user, a private and a public key are generated using the RSA principle.
- The public key is shared with the other user, and will use it to encrypt every message sent.
- The other user will be able to decrypt the message encrypted with its public key using the associated private key.
This code should not be used for security purposes and is only made to demonstrate how asymmetric encryption works.
- Cargo
Clone the repo with :
git clone https://github.com/matheothomas/rust-msg-encryption
cd rust-msg-encryption/
cargo run --bin server 172.0.0.1
cargo run --bin client IP_ADDRESS_SERVER
The mathematic implementation of the RSA algorithm was highly inspired from this repository.