Trait cipher_crypt::Cipher

source ·
pub trait Cipher {
    type Key;
    type Algorithm;

    fn new(key: Self::Key) -> Self::Algorithm;
    fn encrypt(&self, message: &str) -> Result<String, &'static str>;
    fn decrypt(&self, message: &str) -> Result<String, &'static str>;
}

Required Associated Types§

Required Methods§

Initialise a cipher given a specific key.

Encrypt a message using a cipher’s algorithm.

Decrypt a message using a cipher’s algorithm.

Implementors§