pub struct Vigenere { /* private fields */ }
Expand description

A Vigenère cipher.

This struct is created by the new() method. See its documentation for more.

Trait Implementations§

Initialise a Vigenère cipher given a specific key.

Panics
  • The key is empty.
  • The key contains a non-alphabetic symbol.

Encrypt a message using a Vigenère cipher.

Examples

Basic usage:

use cipher_crypt::{Cipher, Vigenere};

let v = Vigenere::new(String::from("giovan"));
assert_eq!("O vsqee mmh vnl izsyig!", v.encrypt("I never get any credit!").unwrap());

Decrypt a message using a Vigenère cipher.

Examples

Basic usage:

use cipher_crypt::{Cipher, Vigenere};

let v = Vigenere::new(String::from("giovan"));
assert_eq!("I never get any credit!", v.decrypt("O vsqee mmh vnl izsyig!").unwrap());

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.