Skip to main content

decrypt_bytes

Function decrypt_bytes 

Source
pub fn decrypt_bytes(
    encrypted: &[u8],
    passphrase: &str,
) -> Result<Vec<u8>, AgentError>
Expand description

Decrypts data using a tagged encryption format and a user-provided passphrase.

Only supports tag 3 (Argon2id): [0x03][salt:16][m_cost:4 LE][t_cost:4 LE][p_cost:4 LE][algo_tag:1][nonce:12][ciphertext]

If decryption fails (e.g. due to wrong passphrase), returns AgentError::IncorrectPassphrase.