Trait Cipher

Source
pub trait Cipher {
    // Required methods
    fn encipher(&self, ptext: &str) -> CipherResult;
    fn decipher(&self, ctext: &str) -> CipherResult;
}
Expand description

Defines the implementation for cipher functionality.

Required Methods§

Source

fn encipher(&self, ptext: &str) -> CipherResult

Should take plaintext as a string reference, and return the enciphered ciphertext as a CipherResult.

Source

fn decipher(&self, ctext: &str) -> CipherResult

Should take the ciphertext as a string reference, and return the deciphered plaintext as a CipherResult.

Implementors§