pub fn derive_key(passphrase: &str, salt: &[u8]) -> Result<Vec<u8>, SyncError>Expand description
Derives an encryption key from a passphrase and salt using Argon2id.
Uses Argon2id with secure default parameters suitable for key derivation. The same passphrase and salt will always produce the same key, allowing encryption and decryption across machines that share the salt and passphrase.
§Arguments
passphrase- The user’s passphrasesalt- A random salt (stored in the ref tree atmeta/saltand reused)
§Returns
A 32-byte key suitable for AES-256-GCM encryption.