pub struct Railfence { /* private fields */ }
Trait Implementations§
Source§impl Cipher for Railfence
impl Cipher for Railfence
Source§fn encrypt(&self, message: &str) -> Result<String, &'static str>
fn encrypt(&self, message: &str) -> Result<String, &'static str>
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());
Source§fn decrypt(&self, ciphertext: &str) -> Result<String, &'static str>
fn decrypt(&self, ciphertext: &str) -> Result<String, &'static str>
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());
type Key = usize
type Algorithm = Railfence
Auto Trait Implementations§
impl Freeze for Railfence
impl RefUnwindSafe for Railfence
impl Send for Railfence
impl Sync for Railfence
impl Unpin for Railfence
impl UnwindSafe for Railfence
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more