decrypt

Function decrypt 

Source
pub fn decrypt(data: &[u8], password: &[u8]) -> Result<Vec<u8>>
Expand description

Decrypts some data and returns the result

ยงExamples

use simple_crypt::{encrypt, decrypt};

let encrypted_data = encrypt(b"example text", b"example password").expect("Failed to encrypt");

let data = decrypt(&encrypted_data, b"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("text.txt", data).expect("Failed to write to file");