https://github.com/slamdev/crypter
CLI to encrypt secrets in config files, so they can be stored safely in git
https://github.com/slamdev/crypter
Last synced: 4 months ago
JSON representation
CLI to encrypt secrets in config files, so they can be stored safely in git
- Host: GitHub
- URL: https://github.com/slamdev/crypter
- Owner: slamdev
- Created: 2020-02-12T13:04:18.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T14:42:51.000Z (about 2 years ago)
- Last Synced: 2025-03-24T09:14:47.264Z (11 months ago)
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# crypter
CLI to encrypt secrets in config files, so they can be stored safely in git.
## Encrypt
```shell script
DEC_SECRET='very-secret-password'
PK=$(cat public-key.pem)
docker run --rm slamdev/crypter crypter encrypt -s "${PK}" -v "${DEC_SECRET}"
```
outputs: `{cipher}base64-data...=={cipher}`
This can be placed in a config file:
```yaml
pg_host: localhost
pg_user: postgres
pg_password: '{cipher}base64-data...=={cipher}'
```
## Decrypt
```shell script
ENC_SECRET=$(cat config.yaml)
PK=$(cat private-key.pem)
docker run --rm slamdev/crypter crypter decrypt -s "${PK}" -v "${ENC_SECRET}"
```
outputs:
```yaml
pg_host: localhost
pg_user: postgres
pg_password: 'very-secret-password'
```