feat: use nonce, salt 16 bytes
This commit is contained in:
@@ -20,7 +20,7 @@ pub fn hmac_encrypt_from_string(plaintext: &str) -> XResult<String> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub fn hmac_encrypt(plaintext: &[u8]) -> XResult<String> {
|
pub fn hmac_encrypt(plaintext: &[u8]) -> XResult<String> {
|
||||||
let hmac_nonce: [u8; 8] = random();
|
let hmac_nonce: [u8; 16] = random();
|
||||||
let aes_gcm_nonce: [u8; 16] = random();
|
let aes_gcm_nonce: [u8; 16] = random();
|
||||||
|
|
||||||
let hmac_key = compute_yubikey_hmac(&hmac_nonce)?;
|
let hmac_key = compute_yubikey_hmac(&hmac_nonce)?;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ pub fn simple_pbe_decrypt_with_prompt(ciphertext: &str) -> XResult<Vec<u8>> {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
pub fn simple_pbe_encrypt(password: &str, iteration: u32, plaintext: &[u8]) -> XResult<String> {
|
pub fn simple_pbe_encrypt(password: &str, iteration: u32, plaintext: &[u8]) -> XResult<String> {
|
||||||
let pbe_salt: [u8; 32] = random();
|
let pbe_salt: [u8; 16] = random();
|
||||||
let key = simple_pbe_kdf(password, &pbe_salt, iteration)?;
|
let key = simple_pbe_kdf(password, &pbe_salt, iteration)?;
|
||||||
let aes_gcm_nonce: [u8; 16] = random();
|
let aes_gcm_nonce: [u8; 16] = random();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user