Skip to content

Oxion7/RC4-rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Running the Program

  1. Clone the Repository

    git clone https://github.com/Oxion7/rc4-rust.git
    cd rc4-rust
  2. Build the Program

    cargo build
  3. Run the Program

    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:

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