Skip to content
/ rc4 Public

An implementation of the RC4 (also sometimes called ARC4) stream cipher

Notifications You must be signed in to change notification settings

rsdump/rc4

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RC4

An implementation of the RC4 (also sometimes called ARC4) stream cipher.

[dependencies]
rc4 = { git = "https://github.com/rsdump/rc4" }

Example

rc4 is dead simple to use:

use std::fs;
use std::io;

fn main() {
    let src = "/tmp/src";
    let dst = "/tmp/dst";
    let k = "secret";

    let r = fs::File::open(src).unwrap();
    let mut r = rc4::Reader::new(r, k.as_bytes()).unwrap();
    let mut w = fs::File::create(dst).unwrap();
    // Awesome! r implements io::Read, so it works well with the standard library.
    io::copy(&mut r, &mut w).unwrap();
}

About

An implementation of the RC4 (also sometimes called ARC4) stream cipher

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages