pub struct Autokey { /* private fields */ }
Expand description
An Autokey cipher implementation.
Implementations§
Trait Implementations§
Source§impl Cipher for Autokey
impl Cipher for Autokey
Source§fn encipher(&self, ptext: &str) -> CipherResult
fn encipher(&self, ptext: &str) -> CipherResult
Enciphers the given plaintext (a str reference) using the Autokey cipher
and returns the ciphertext as a CipherResult
.
§Example
use ciphers::{Cipher, Autokey};
let autokey = Autokey::new("FORTIFICATION");
let ctext = autokey.encipher("DEFENDTHEEASTWALLOFTHECASTLE");
assert_eq!(ctext.unwrap(), "ISWXVIBJEXIGGZEQPBIMOIGAKMHE");
Source§fn decipher(&self, ctext: &str) -> CipherResult
fn decipher(&self, ctext: &str) -> CipherResult
Deciphers the given ciphertext (a str reference) using the Autokey cipher
and returns the plaintext as a CipherResult
.
§Example
use ciphers::{Cipher, Autokey};
let autokey = Autokey::new("FORTIFICATION");
let ptext = autokey.decipher("ISWXVIBJEXIGGZEQPBIMOIGAKMHE");
assert_eq!(ptext.unwrap(), "DEFENDTHEEASTWALLOFTHECASTLE");
Auto Trait Implementations§
impl Freeze for Autokey
impl RefUnwindSafe for Autokey
impl Send for Autokey
impl Sync for Autokey
impl Unpin for Autokey
impl UnwindSafe for Autokey
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