Skip to main content

generate_encryption_key_simple

Function generate_encryption_key_simple 

Source
pub fn generate_encryption_key_simple(password: &str) -> [u8; 32]
Expand description

Generate a 16-byte encryption key from a password using SHA-256

This function:

  1. Combines password with fixed salt
  2. Hashes using SHA-256 (produces 32 bytes)
  3. Takes the first 16 bytes of the hash as the encryption key

Password requirements:

  • Minimum length: 10 characters
  • Maximum length: 20 characters