This repository contains an implementation of the RC4 stream cipher algorithm in Rust. The program allows you to encrypt and decrypt messages using RC4.
- Key Scheduling Algorithm (KSA)
- Pseudo-Random Generation Algorithm (PRGA)
- Real-time encryption and decryption of input text
- Hexadecimal output for ciphertext
- Support for UTF-8 plaintext and decryption back to the original text
- Rust programming language installed. You can download it from rust-lang.org.
-
Clone the Repository
git clone https://github.com/Oxion7/rc4-rust.git cd rc4-rust
-
Build the Program
cargo build
-
Run the Program
cargo run
Upon running the program, you will be prompted to enter a key and the plaintext to encrypt. The program will output the ciphertext in hexadecimal format and then decrypt it back to show the original plaintext.
Example:
Enter the key: mysecretkey
Enter the plaintext: hello world
Ciphertext (hex): 3e 14 23 3d 25 8b 2c 8b 1a 15 5a
Decrypted: hello world
Decrypted text: hello world