pub fn file_encrypt(plaintext: String, dv: String, iv: String) -> String {
    // derive secret
    let secret: String = derive_password(dv);
    // decode IV
    let initialization_vector: Vec<u8> = base64::decode(iv).unwrap();
    // encrypt string
    let ciphertext: Vec<u8> = aes_256_gcm_siv_encrypt(secret, initialization_vector, plaintext);
    // base64 encode Vec<u8>
    base64::encode(ciphertext)
}
// Encrypt function wrapper for File Backend
Encrypt function wrapper for File Backend
Encrypt function wrapper for File Backend
pub fn file_encrypt(plaintext: String, dv: String, iv: String) -> String {
    // derive secret
    let secret: String = derive_password(dv);
    // decode IV
    let initialization_vector: Vec<u8> = base64::decode(iv).unwrap();
    // encrypt string
    let ciphertext: Vec<u8> = aes_256_gcm_siv_encrypt(secret, initialization_vector, plaintext);
    // base64 encode Vec<u8>
    base64::encode(ciphertext)
}
pub fn file_encrypt ( plaintext : String , dv : String , iv : String ) -> String { // derive secret let secret : String = derive_password ( dv ) ; // decode IV let initialization_vector : Vec < u8 > = base64 :: decode ( iv ) . unwrap ( ) ; // encrypt string let ciphertext : Vec < u8 > = aes_256_gcm_siv_encrypt ( secret , initialization_vector , plaintext ) ; // base64 encode Vec<u8> base64 :: encode ( ciphertext ) }
Encrypt function wrapper for File Backend
Encrypt function wrapper for File Backend
plaintext
String
dv
String
iv
String
plaintext
String
dv
String
iv
String