From f77cd2aa1c8b78a98cff0b3b520cbed993e2f66d Mon Sep 17 00:00:00 2001 From: EETagent Date: Sun, 30 Oct 2022 22:02:33 +0100 Subject: [PATCH] chore: AES information --- core/src/crypto.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/crypto.rs b/core/src/crypto.rs index 07a8522..82e05b1 100644 --- a/core/src/crypto.rs +++ b/core/src/crypto.rs @@ -100,6 +100,8 @@ pub async fn encrypt_password( let hash = tokio::task::spawn_blocking(move || { let aes_key_nonce = convert_key_aes256(&key); + // Nonce should be always unique, but for our use case it's fine + // Also aes-gcm-siv is not vulnerable to nonce reuse let nonce = aes_gcm_siv::Nonce::from_slice(&aes_key_nonce[..12]); let cipher = aes_gcm_siv::Aes256GcmSiv::new_from_slice(&aes_key_nonce[..32]).unwrap();