Vault
Constants
Class methods
Decrypt all encrypted values in a dotenv file content string.
Decrypt encrypted values in a loaded hash (from Dotenv.load).
Decrypt an "encrypted:..." value with a password. Raises Vault::Error on wrong password or tampered data.
Encrypt all plaintext values in a dotenv file content string. Returns {encrypted_content, skipped_keys}.
Encrypt a plaintext value with a password. Uses AES-256-CBC + HMAC-SHA256 (Encrypt-then-MAC). Returns "encrypted:" + Base64(salt[16] + iv[16] + hmac[32] + ciphertext[N])
Check if any values in a hash are encrypted.
Load dotenv files, decrypting each file with its own password. Tries previously entered passwords first before prompting. Passwords are stored obfuscated (XOR'd with random pad) in memory. Returns merged vars and updated password cache.
Prompt for password on STDERR (hidden input).
Zero out a String's backing memory to remove sensitive data. Safe with Boehm GC (non-moving collector).
Wipe all cached obfuscated passwords.