Ansible Vault Encrypt/Decrypt
Read and write $ANSIBLE_VAULT;1.1;AES256 files with a password — locally, with Web Crypto and no uploads.
Secret to encrypt
The password is never stored or transmitted. Press Enter to run.
Vault block
Enter a secret and a password to create a vault block
Nothing leaves your browser — no uploads, no history, no storage.
Anatomy of a vault file
Ansible writes a header line, then the hex of an inner record wrapped at 80 characters per line. The inner record holds three hex strings; nothing else. A 1.2 header adds a vault-id label after the cipher.
- Outer header
- Version (1.1 / 1.2), cipher AES256, optional vault-id.
- Inner record
- <salt-hex> / <HMAC-hex> / <ciphertext-hex>, each on its own line before the outer hex.
- Keys
- PBKDF2-HMAC-SHA256, 10,000 iterations, 80 output bytes → AES key, HMAC key, 16-byte IV.
- Integrity
- HMAC-SHA256 covers the raw ciphertext and is checked before decryption; a wrong password and a modified file are indistinguishable.
Output is drop-in compatible with ansible-vault view / decrypt. Vaults made with a custom iteration count (configurable in newer Ansible) cannot be read here. For production secrets, check your organisation's policy before pasting anything into a browser.
Details
This tool writes and reads the exact Ansible Vault 1.1/1.2 envelope: PBKDF2-HMAC-SHA256 with 10,000 iterations derives an AES-256-CTR key, an HMAC-SHA256 key and a 16-byte IV. The HMAC is checked over the raw ciphertext before any decryption, so a wrong password and a damaged vault are indistinguishable. Output is drop-in compatible with ansible-vault view/decrypt. Everything runs in your browser tab: no password, plaintext or vault content is uploaded or stored. Vaults produced with a custom iteration count (configurable in newer Ansible releases) cannot be read here.
More examples
A vaulted variables file
$ANSIBLE_VAULT;1.1;AES256
38653138663932383663346464666336633738643835373566…
… (80-char hex lines)Paste the whole block and its password on the Decrypt tab to read the original YAML. The header, salt, HMAC and double-hex wrapping match what ansible-vault writes.
Encrypt a CI secret
db_password: change-me
api_token: abc123
Password: example → $ANSIBLE_VAULT;1.1;AES256…Type the secret, enter and confirm the password, then click Encrypt. Copy the resulting block into a .yml file; ansible-vault can decrypt it unchanged.
Vault 1.2 with a label
$ANSIBLE_VAULT;1.2;AES256;prod
3030303130323033303430353036303730383039…The optional vault-id label appears in the header only. Set the label field when encrypting to produce a 1.2 block, or decrypt an existing labelled block as usual.
Examples
Vaulted YAML variables
db_password: s3cr3t
api_token: abc123
· password: example$ANSIBLE_VAULT;1.1;AES256
30303031303230… (wrapped hex)The output can be saved as a .yml file and decrypted by ansible-vault with the same password.
Read a labelled vault
$ANSIBLE_VAULT;1.2;AES256;prod + passwordservice: "café ✓"The 1.2 label is displayed in the result meta and preserved when the block is copied; the inner record is unchanged.
Wrong password
Vault block + password: nopeWrong password or corrupted data.Authentication fails identically for a wrong password and a single flipped ciphertext bit, so the error leaks no password oracle.
About this tool
Ansible Vault protects variables and whole files with a password. This tool reads and writes the exact Vault 1.1/1.2 AES256 envelope, so a block copied out of it works with ansible-vault view, decrypt and edit — and a vault file produced by the CLI can be pasted in and read here. Generic AES tools emit a different format and cannot be used interchangeably.
The envelope has two layers. The header line names the version, cipher and optional vault-id; the lines below it hold the hex of an inner record made from the salt, HMAC and ciphertext, wrapped at 80 characters per line. Keys come from PBKDF2-HMAC-SHA256 (10,000 iterations, 80 output bytes): the first 32 bytes encrypt with AES-256-CTR, the next 32 authenticate with HMAC-SHA256, and the last 16 are the counter. The HMAC covers raw ciphertext bytes and is verified before any plaintext is produced, so a wrong password and a modified vault share one error message.
Everything happens in this browser tab with Web Crypto. Passwords, secrets and vault contents are never uploaded, saved to storage or kept in a server log. Decrypted plaintext is masked until you reveal it, and the copy action explains that clipboard auto-clear is best-effort because browsers may block a delayed clipboard write.
What this tool does not do
- Only Vault 1.1 and 1.2 with AES256 are supported; legacy 1.0 / AES is rejected with a specific message.
- The PBKDF2 iteration count is fixed at Ansible's 10,000 default; vaults with a custom count cannot be decrypted.
- Only UTF-8 text is handled; binary plaintext produces an explicit encoding error rather than replacement characters.
- No vault re-keying, secret storage, network calls or YAML schema validation is performed.
How to use this tool
Choose Encrypt or Decrypt
Use Encrypt to turn text into a vault block, or Decrypt to read an existing block. Pasting text that begins with $ANSIBLE_VAULT switches to Decrypt automatically.
Enter the secret or vault block
Type the plaintext or paste the complete vault file, including its header and every wrapped hex line. You can also upload a .yml, .yaml or .txt file. Multiple vault blocks are decrypted as separate sections.
Enter the password
Type the vault password; it is never pre-filled or stored. On Encrypt, confirm it in the second field — a typo would otherwise create an unrecoverable secret. Use the eye button to show or hide it, and press Enter to run.
Add a vault-id label if needed
An optional label makes the output a 1.2 header. Labels must not contain spaces or semicolons. Ansible treats the literal label 'default' as unlabelled and writes 1.1 instead.
Copy or verify
Copy or download the result. Reveal plaintext only when you are ready; the Self-test button encrypts and decrypts a sample with the current password to confirm the round trip.
Use cases
Loaner-laptop triage
Inspect one vaulted variable when ansible-vault is not installed and installing it is not an option.
CI secret preparation
Produce a drop-in vault block from a workstation that has a browser but no Python or Ansible tooling.
Format verification
Check that tooling output uses the real double-hex vault envelope, the right HMAC and the expected 80-column wrapping.
Vault envelope fields
| Field | Meaning |
|---|---|
| $ANSIBLE_VAULT;1.1;AES256 | Current default header; no vault-id label. |
| $ANSIBLE_VAULT;1.2;AES256;label | Same envelope with a vault-id label in the outer header only. |
| Outer hex lines | Hex of the ASCII inner record, wrapped at 80 characters per line. |
| Inner record | Three lines: 64-char salt hex, 64-char HMAC hex, ciphertext hex. |
| $ANSIBLE_VAULT;1.0;AES | Legacy format; shown with a specific unsupported-format message. |
The HMAC is calculated over the raw ciphertext bytes, not their hex representation. Decryption verifies it before AES-CTR and PKCS#7 unpadding.
Common mistakes
Mistake:Pasting only the first hex line of a long vault file.
Fix:Copy from $ANSIBLE_VAULT through the final hex line; a truncated body fails hex or HMAC validation.
Mistake:Typing the password once and assuming it was right.
Fix:Use the confirmation field on Encrypt; the Self-test button also verifies that a password round-trips.
Mistake:Expecting a vault created with a custom iteration count to decrypt.
Fix:This tool uses Ansible's 10,000-iteration default; re-encrypt with a compatible configuration first.
Mistake:Assuming clipboard auto-clear is guaranteed.
Fix:Browsers may reject delayed clipboard writes. The notice says so; avoid shared machines with clipboard history enabled.
Frequently asked questions
Does this produce the exact Ansible Vault format?
Yes. The output is a $ANSIBLE_VAULT;1.1;AES256 (or 1.2 with a label) header followed by the hex of an inner salt / HMAC / ciphertext record, wrapped at 80 characters per line. Keys come from PBKDF2-HMAC-SHA256 with 10,000 iterations, the cipher is AES-256-CTR with PKCS#7 padding, and HMAC-SHA256 authenticates the raw ciphertext. ansible-vault can read the result unchanged.
Where does my password go?
Nowhere. It stays in this browser tab in memory for the duration of the operation. There is no account, no server request, no localStorage and no usage history. The password field is masked by default and your plaintext is blurred until you reveal it.
What is the difference between Vault 1.1 and 1.2 headers?
Both use the same encryption envelope. 1.1 is $ANSIBLE_VAULT;1.1;AES256 with no label. 1.2 appends ;<vault_id> to the header only, letting Ansible pick the right password identity. This tool reads both and writes 1.2 when you supply a vault-id label.
Why is the HMAC checked before decryption?
That is Ansible's envelope design: an attacker who modifies the ciphertext cannot make a decryption attempt produce plausible-looking garbage. Verifying HMAC-SHA256 first also lets the tool report one identical message for a wrong password or corrupted data, avoiding a password oracle.
Can I decrypt a vault with a custom iteration count?
Not here. Ansible 2.4+ makes the PBKDF2 iteration count configurable, but the vault format does not record it. This tool uses the long-standing default of 10,000 iterations; a vault created with a different count fails authentication. Re-encrypt it with the default before using this page.
Do vault-id labels work on decrypt?
Yes. A 1.2 label is read from the header and shown in the result meta. A label on a 1.1 header — which some tools emit even though it is nonstandard — is tolerated with a warning. Labels containing spaces or semicolons are rejected on encrypt because they would break the header.
Can I paste several vault blocks at once?
Yes. Each $ANSIBLE_VAULT block in the paste is decrypted separately with the same password and the plaintext appears in its own labelled section. If one block fails authentication the whole run reports which block failed.
Is clipboard auto-clear guaranteed?
No. After a copy, the tool attempts to overwrite the clipboard after 60 seconds, but browsers often block delayed clipboard writes without a fresh user gesture, and OS-level clipboard history may keep the value. The notice shown after copying says this is best-effort; avoid pasting production secrets on shared machines.
Can I decrypt old Vault 1.0 / AES files?
No. Those legacy vaults use a different cipher and key derivation. The tool detects that header and tells you to re-encrypt the file with a current ansible-vault before using it here.
References & standards
Related tools
AES Encryption
Encrypt and decrypt text with AES-GCM and a passphrase, fully in your browser. Uses PBKDF2 key derivation and the Web Crypto API — your data and keys never leave your device.
Android Network Security Config Builder
Generate network_security_config.xml with cleartext rules, trust anchors, certificate pinning and debug-only CAs — plus the manifest snippet and file placement checklist.
Argon2 Hash Generator & Verifier
Generate Argon2id/2i/2d hashes with proper m/t/p parameters and verify PHC strings — reference algorithm in your browser, nothing uploaded.
AWS Signature V4 Builder
Build AWS Signature V4 headers and presigned URLs from a canonical request — signed curl, key chain and debug diff, computed locally in your browser.
Basic Auth Generator
Generate an HTTP Basic Authentication header from a username and password. Produces the Authorization header and ready-to-use curl and fetch snippets. Runs fully client-side.
Bcrypt Generator & Verifier
Hash passwords with bcrypt and verify hashes — choose your cost factor (rounds 4–15), get a secure hash instantly, and check whether a password matches a hash. Runs entirely in your browser.