pub struct Railfence { /* private fields */ }

Trait Implementations§

Initialise a Railfence cipher given a specific key (number of rails).

Panics
  • The key is 0.

Encrypt a message using a Railfence cipher.

Examples

Basic usage:

use cipher_crypt::{Cipher, Railfence};

let r = Railfence::new(3);
assert_eq!("Src s!ue-ertmsaepseeg", r.encrypt("Super-secret message!").unwrap());

Decrypt a message using a Railfence cipher.

Examples

Basic usage:

use cipher_crypt::{Cipher, Railfence};

let r = Railfence::new(3);
assert_eq!("Super-secret message!", r.decrypt("Src s!ue-ertmsaepseeg").unwrap());

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.