playfair_cipher 0.2.2

Playfair cipher as described at <https://en.wikipedia.org/wiki/Playfair_cipher>.
Documentation

playfair_cipher

Implementation of the PlayFair cipher - nothing special, nothing useful, just for fun.

Encrypt

use playfair_cipher::{PlayFairKey, CharNotInKeyError};

let pfc = PlayFairKey::new("playfair example");
match pfc.encrypt("hide the gold in the tree stump") {
  Ok(crypt) => {
    assert_eq!(crypt, "BMODZBXDNABEKUDMUIXMMOUVIF");
  }
  Err(e) => panic!("CharNotInKeyError {}", e),
};

Decrypt

use playfair_cipher::{PlayFairKey, CharNotInKeyError};

let pfc = PlayFairKey::new("playfair example");
match pfc.decrypt("BMODZBXDNABEKUDMUIXMMOUVIF") {
  Ok(crypt) => {
    assert_eq!(crypt, "HIDETHEGOLDINTHETREXESTUMP");
  }
  Err(e) => panic!("CharNotInKeyError {}", e),
};

That's it.