Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tweedegolf/ansible-vault-rs
Decrypt ansible vault 1.1 files in Rust
https://github.com/tweedegolf/ansible-vault-rs
Last synced: about 1 month ago
JSON representation
Decrypt ansible vault 1.1 files in Rust
- Host: GitHub
- URL: https://github.com/tweedegolf/ansible-vault-rs
- Owner: tweedegolf
- License: mit
- Created: 2019-01-18T13:59:11.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-08-04T11:15:56.000Z (over 2 years ago)
- Last Synced: 2024-09-27T15:04:32.145Z (about 2 months ago)
- Language: Rust
- Size: 23.4 KB
- Stars: 6
- Watchers: 7
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ansible-vault
```toml
[dependencies]
ansible-vault = "0.2.1"
```Encrypt and decrypt Ansible Vault files
This library provides methods to encrypt and decrypt ansible vault data, in 1.1 format
It exposes six methods:
* encrypt : Encrypt the input to a string without header `$ANSIBLE_VAULT;1.1;AES256` nor indentation,
* encrypt_vault : Encrypt the input, and format like ansible (with header and indentation),
* encrypt_vault_from_file : Encrypt the given file (wrapper for `encrypt_vault`)
* decrypt : Decrypt a message string without header nor indentation
* decrypt_vault : Decrypt a vault intput (with header and optionally indentation)
* decrypt_vault_from file : Decrypt an ansible vault from file (wrapper for `decrypt_vault`)### Usage
Simple usage```rust
use ansible_vault::{encrypt_vault, decrypt_vault};
let lipsum = "Lorem ipsum dolor…";
let encoded = encrypt_vault(lipsum.as_bytes(),"5Up€rs3creT").unwrap();
let decoded = decrypt_vault(encoded.as_bytes(), "5Up€rs3creT").unwrap();
let decoded_str = String::from_utf8(decoded).unwrap();
assert_eq!(lipsum, decoded_str);
```License: MIT