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) -> String;
fn decrypt(&self, message: &str) -> String;
}
Associated Types
Required Methods
fn new(key: Self::Key) -> Result<Self::Algorithm, &'static str>
Initialise a cipher given a specific key.
fn encrypt(&self, message: &str) -> String
Encrypt a message using a cipher's algorithm.
fn decrypt(&self, message: &str) -> String
Decrypt a message using a cipher's algorithm.