From 914222976cdc218922be7fbaf8389ef8be83f7be Mon Sep 17 00:00:00 2001 From: Awiteb Date: Tue, 7 May 2024 20:21:22 +0300 Subject: [PATCH] chore: Encrypt the exported json with the given key --- src/vault/mod.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/vault/mod.rs b/src/vault/mod.rs index cf7c0f2..47f6468 100644 --- a/src/vault/mod.rs +++ b/src/vault/mod.rs @@ -130,11 +130,9 @@ impl Vaults { /// - if the encryption failed /// /// Note: The returned string is `Vec` - pub fn json_export(&self) -> LprsResult { + pub fn json_export(&self, encryption_key: &[u8; 32]) -> LprsResult { let encrypt = |val: &str| { - LprsResult::Ok( - crate::BASE64.encode(cipher::encrypt(&self.master_password, val.as_ref())), - ) + LprsResult::Ok(crate::BASE64.encode(cipher::encrypt(encryption_key, val.as_ref()))) }; serde_json::to_string(