Function simple_crypt::decrypt
source · [−]Expand description
Decrypts some data and return the result
Examples
use simple_crypt::{encrypt, decrypt};
let encrypted_data = encrypt(b"example text", "example passowrd").expect("Failed to encrypt");
let data = decrypt(&encrypted_data, "example passowrd").expect("Failed to decrypt");
// and now you can print it to stdout:
// println!("data: {}", String::from_utf8(data.clone()).expect("Data is not a utf8 string"));
// or you can write it to a file:
// fs::write("test.txt", data).expect("Failed to write to file");