pub struct FPE { /* fields omitted */ }
Represents an instance of format preserving encryption
use std::str::FromStr;
let modulus = botan::MPI::from_str("1000000000").unwrap();
let key = vec![0; 32];
let rounds = 16;
let compat_mode = false;
let fpe = botan::FPE::new_fe1(&modulus, &key, rounds, compat_mode).unwrap();
let input = botan::MPI::from_str("9392024").unwrap();
let tweak = vec![1,2,3,4,5];
let ctext = fpe.encrypt(&input, &tweak).unwrap();
assert!(ctext < modulus);
let ptext = fpe.decrypt(&ctext, &tweak).unwrap();
assert_eq!(ptext, input);
Create a new FPE instance, FE1 scheme
Rounds should be 16 or higher for best security
Encrypt value under the FPE scheme using provided tweak
Decrypt value under the FPE scheme using provided tweak
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more