This One-Time Pad (OTP) encryption system provides a secure method of encrypting and decrypting messages using the unbreakable OTP encryption technique. The project consists of two main components: an encryption server (enc_server
) and a decryption server (dec_server
), along with corresponding clients (enc_client
and dec_client
) that communicate with these servers to perform encryption and decryption operations.
- Secure Communication: Leverages the OTP method for encryption, ensuring the confidentiality of the message as long as the key is kept secret and used only once.
- Server-Client Architecture: Implements a server-client model, allowing encryption and decryption operations to be performed over the network.
- Concurrent Handling: Both servers can handle multiple client connections concurrently, thanks to multi-threading.
- Handshake Protocol: Includes an application-level handshake protocol to prevent incorrect client-server connections.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- Rust programming language (latest stable version recommended)
- Cargo (Rust's package manager and build system)
- Clone the Repository:
git clone [email protected]:slucasmyer/otp-rust.git
cd otp-rust
- Build the Project:
cargo build --release
- Run it:
cargo run --bin enc_server <enc_port> &
cargo run --bin dec_server <dec_port> &
cargo run --bin keygen <key_length (must be at least as long as file to be encrypted)> > key
cargo run --bin enc_client plaintext* key <enc_port> > ciphertext*
cargo run --bin dec_client ciphertext* key <dec_port> > decrypted*
Alternatively, you can use the provided testing_script.sh
script to run the servers, generate keys, and invoke the clients to encrypt and decrypt the provided plaintext files.
./testing_script.sh