Trait cipher_crypt::Cipher
source · pub trait Cipher {
type Key;
type Algorithm;
fn new(key: Self::Key) -> Result<Self::Algorithm, &'static str>;
fn encrypt(&self, message: &str) -> Result<String, &'static str>;
fn decrypt(&self, message: &str) -> Result<String, &'static str>;
}Required Associated Types§
Required Methods§
sourcefn new(key: Self::Key) -> Result<Self::Algorithm, &'static str>
fn new(key: Self::Key) -> Result<Self::Algorithm, &'static str>
Initialise a cipher given a specific key.