Skip to main content

Module encryption

Module encryption 

Source
Expand description

State file encryption module.

Structs§

EncryptionConfig
Encryption configuration
StateEncryption
Transparent encryption wrapper for file operations.

Functions§

decrypt
Decrypt data using AES-256-GCM with PBKDF2 key derivation
encrypt
Encrypt data using AES-256-GCM with PBKDF2 key derivation
is_encrypted
Check if data appears to be encrypted (starts with base64-encoded salt) This is a heuristic check - it may give false negatives for very short or specially crafted plaintexts, but should work for normal JSON state files.
mask_passphrase
Mask a passphrase for safe display, showing only the first and last characters with asterisks in between. Passphrases with fewer than 3 characters are fully masked.
read_decrypted
Read and decrypt a file
write_encrypted
Write and encrypt data to a file