Trait cipher_crypt::Cipher [] [src]

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>; }

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