Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/oxion7/rc4-rust

RC4 algorithm in rust
https://github.com/oxion7/rc4-rust

algorithm cipher cryptography stream-cipher

Last synced: 5 days ago
JSON representation

RC4 algorithm in rust

Awesome Lists containing this project

README

        

# RC4 Algorithm in Rust

This repository contains an implementation of the RC4 stream cipher algorithm in Rust. The program allows you to encrypt and decrypt messages using RC4.

## Features

- 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

## Getting Started

### Prerequisites

- Rust programming language installed. You can download it from [rust-lang.org](https://www.rust-lang.org/).

### Running the Program

1. **Clone the Repository**

```sh
git clone https://github.com/Oxion7/rc4-rust.git
cd rc4-rust
```

2. **Build the Program**

```sh
cargo build
```

3. **Run the Program**

```sh
cargo run
```

### Usage

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:

```sh
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