[](https://crates.io/crates/rvault)
# rvault
A tool to encrypt or decrypt JSON or YAML files that contain partial Ansible vault encrypted values.
This is a Rust port from here: https://github.com/OkieOth/partial-vaults/tree/main
## Overview
rvault allows you to work with files that have a mix of plain text and Ansible Vault encrypted values. Unlike standard Ansible Vault which encrypts entire files, this tool lets you:
- Encrypt specific values within JSON or YAML files
- Decrypt specific values while leaving others encrypted
- Process nested structures with selective encryption
## Install
```bash
# install
cargo install oth_rvault
# use
rvault --help
```
## Usage
```bash
# discover the provided flags our use the interactive mode
cargo run --help
# run docker image
docker run --rm -u (id -u $USER):(id -g $USER) \
docker.io/okieoth/rvault:0.2.0 --version
# run docker image to decrypt a file
docker run --rm -u (id -u $USER):(id -g $USER) \
-v {PATH_TO_INPUT}:/input \
-v {PATH_TO_OUTPUT}:/output \
docker.io/okieoth/rvault:0.2.0 decrypt \
-i /input/{YOUR_FILE} -o /output/{YOUR_OUTPUT_FILE} \
--password {YOUR_PASSWORD}
```
## Build
You can build this tool from source as native build or as docker image
```bash
# build binary
# Requirements: installed golang 1.24, make
make build
# build docker image
# Requirements: installed docker
make docker-build
```
# Additional
* Passwort for `resources/tests/partial.yaml`: aa
* Passwort for `resources/tests/partial_encrypted_example.json`: test999
* Passwort for `resources/tests/partial_encrypted_example.yaml`: test999