pub fn file_decrypt(base64_ciphertext: String, dv: String, iv: String) -> String {
    // base64 decode string
    let ciphertext: Vec<u8> = base64::decode(base64_ciphertext).unwrap();
    // derive secret
    let secret: String = derive_password(dv);
    // decode IV
    let initialization_vector: Vec<u8> = base64::decode(iv).unwrap();
    // decrypt Vec<8u>
    let plaintext: Vec<u8> = aes_256_gcm_siv_decrypt(secret, initialization_vector, ciphertext);
    // Return decrypted text
    return str::from_utf8(&plaintext).unwrap().to_string();
}
// Decrypt function wrapper for File Backend
Decrypt function wrapper for File Backend
Decrypt function wrapper for File Backend
pub fn file_decrypt(base64_ciphertext: String, dv: String, iv: String) -> String {
    // base64 decode string
    let ciphertext: Vec<u8> = base64::decode(base64_ciphertext).unwrap();
    // derive secret
    let secret: String = derive_password(dv);
    // decode IV
    let initialization_vector: Vec<u8> = base64::decode(iv).unwrap();
    // decrypt Vec<8u>
    let plaintext: Vec<u8> = aes_256_gcm_siv_decrypt(secret, initialization_vector, ciphertext);
    // Return decrypted text
    return str::from_utf8(&plaintext).unwrap().to_string();
}
pub fn file_decrypt ( base64_ciphertext : String , dv : String , iv : String ) -> String { // base64 decode string let ciphertext : Vec < u8 > = base64 :: decode ( base64_ciphertext ) . unwrap ( ) ; // derive secret let secret : String = derive_password ( dv ) ; // decode IV let initialization_vector : Vec < u8 > = base64 :: decode ( iv ) . unwrap ( ) ; // decrypt Vec<8u> let plaintext : Vec < u8 > = aes_256_gcm_siv_decrypt ( secret , initialization_vector , ciphertext ) ; // Return decrypted text return str :: from_utf8 ( & plaintext ) . unwrap ( ) . to_string ( ) ; }
Decrypt function wrapper for File Backend
Decrypt function wrapper for File Backend
base64_ciphertext
String
dv
String
iv
String
base64_ciphertext
String
dv
String
iv
String