#cipher #rc5 #scheme #rivest #implemntation

rivest_cipher

Simple module with Rivest Cipher implemntation

1 unstable release

0.1.0 Dec 22, 2022

#2035 in Cryptography

48 downloads per month

MIT license

14KB
298 lines

Rivest cipher

Simple Rust module with Rivest Cipher implementation.

Implemented schemes

  • RC2
  • RC5 (RC5/8 RC5/16 RC5/32 RC5/64)
  • RC6

Usage

Installation

cargo add rivest_cipher

Example

use rivest_cipher::schemes::rc5;

let key: [u8; 64] = { ... };
let plaintext: [u8; 16] = { ... };

let encryptor: Rc5<u32> = rc5::setup::<u32>(&key, 12);
let ciphertext: Vec<u8> = encryptor.encrypt(&plaintext).unwrap();

assert_eq!(plaintext.as_slice(), encryptor.decrypt(&ciphertext).unwrap().as_slice());

lib.rs:

Implementation of Rivest Cipher encryption modules

Implemented schemes:

  • RC2
  • RC5
  • RC6

Dependencies

~155KB