Skip to content

zacharysiegel/secr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

secr   Latest Version

A simple secret manager.

Manage encrypted secrets stored in a file. Uses the ChaCha20Poly1305 algorithm.

Usage

Install secr to your system via Cargo

cargo install secr

Generate a symmetric encryption key:

secr key

Example:

$ secr key
Generated key (base64):
2Af8Ty6PG9ICZppnY5cB8GMPdNg4NubxU4HyPEx1h0E=

Encrypt a secret

secr encrypt --key '<symmetric_key>' '<plaintext>'

Output is preformatted in YAML. Example:

$ secr encrypt --name 'hello_world' --key '2Af8Ty6PG9ICZppnY5cB8GMPdNg4NubxU4HyPEx1h0E=' 'mysecret'
hello_world:
    nonce: 'qt+WBOWfII63uI9q'
    ciphertext: 'qTEMbZ5SZVox7Mmsc61cXbEbzYuKVO1u'

Add the encrypted secret to a data store

Example:

cat >> secrets.yaml << 'EOF'
hello_world:
  nonce: 'qt+WBOWfII63uI9q'
  ciphertext: 'qTEMbZ5SZVox7Mmsc61cXbEbzYuKVO1u'
EOF

Decrypt the secret

secr decrypt --file '<store_path>' --key '<symmetric_key>' '<secret_name>'

Example:

$ secr decrypt --file secrets.yaml --key '2Af8Ty6PG9ICZppnY5cB8GMPdNg4NubxU4HyPEx1h0E=' 'hello_world'
UTF-8 encoding:
mysecret
Base64 encoding:
bXlzZWNyZXQ=

Versioning

This package follows the Semantic Versioning convention.

License

Licensed under the MIT license.

About

A simple secret manager

Topics

Resources

License

Stars

Watchers

Forks