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§
Sourcefn encipher(&self, ptext: &str) -> CipherResult
fn encipher(&self, ptext: &str) -> CipherResult
Should take plaintext as a string reference, and return the enciphered ciphertext as
a CipherResult
.
Sourcefn decipher(&self, ctext: &str) -> CipherResult
fn decipher(&self, ctext: &str) -> CipherResult
Should take the ciphertext as a string reference, and return the deciphered plaintext
as a CipherResult
.