How do you recognize Ansible Vault text?

Ansible Vault text starts with a header line, $ANSIBLE_VAULT;1.1;AES256, followed by long lines of hexadecimal digits, 0 to 9 and a to f. Vaults made with a vault ID name it at the end of the header, as in $ANSIBLE_VAULT;1.2;AES256;prod. You'll find vault text as whole encrypted files, such as vault.yml, or as single values after !vault | in a YAML file.

Tool description

Enter the vault password in Vault password first, then paste the vault text into Encrypted vault. The decrypted text appears in Plaintext as you type or paste, ready to copy. The tool reads vault versions 1.1 and 1.2 with AES-256. A vault ID label in the header doesn't matter here: you only need the password that belongs to it. To encrypt a secret, use the Ansible Vault Encryptor, or press the swap button to turn the conversion around.

Example

With the vault password watering-can, this vault:

$ANSIBLE_VAULT;1.1;AES256
61646136623465346532396161643063333765386332613230626165353830326232393431643661
3835333064303637386165366438336638353039323766380a323139386531343962303735326332
61383862303666316265313964303933626531393031336535663665356336366264656535663834
3466326530616636650a646661626232356266346163643738376164653733313838616464663832
63376661346236613362323232623765643863303438333233623534356665343936646562393634
36656337663930643530366232356539633466346466383031643337653761303564303235333033
36363338623831333964386461353137343063346435636535376335653237643165663337656136
30626232616664303737

decrypts to:

garden_shop_user: tulip
garden_shop_password: sunflower-seeds-24
YAML

Error messages

Message What it means and what to do
"Password is required" Vault password is empty. Type the password.
Bad vault header The first line isn't a vault header. Paste from the $ANSIBLE_VAULT line on, without the variable name and the !vault tag before it.
Invalid vault Part of the vault is missing. Copy the whole block, down to its last line.
Integrity check failed The password is wrong, or the vault text has changed. Check the password, and remove any spaces at the start of the lines.

Tips

  • A single value copied from a YAML file is indented. Remove the spaces at the start of each line before you paste it, or even the right password gives Integrity check failed.
  • To change a secret, decrypt it, edit the text and encrypt it again with the same password.
  • Everything runs in your browser, so the password and the secret never leave your device.