chore: AES information

This commit is contained in:
EETagent 2022-10-30 22:02:33 +01:00
parent f6f8f45350
commit f77cd2aa1c

View file

@ -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();