A simple utility to encrypt & decrypt files with AES-256 with passphrases
- Encrypt files using a single passphrase
- Decryption requires the passphrase & a randomly-generated cryptographically-strong salt
- Easy to wrap my two brain cells around
First install go
from https://go.dev/dl then run the following commands:
go install github.com/keogami/crypt/cmd/crypt@latest
That's the end of it :3
Run crypt by itself to get usage info:
crypt
NAME:
crypt - encrypt and decrypt files with AES-256
USAGE:
crypt [global options] command [command options] [arguments...]
COMMANDS:
encrypt, en, e encrypt the given file and outputs to stdout
decrypt, de, d decrypt the given file and outputs to stdout (on failure outputs nothing)
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--passphrase value, --pass value, -p value passphrase to be used for operations; if empty, you will be prompted to type it in
--salt value, -s value the file where the salt is to be stored or loaded from
--output value, --out value, -o value output is the path to the file where the output is stored, defaults to stdout
--help, -h show help (default: false)
To encrypt files you need to specify three things:
- A passphrase using
-p
- An output path using
-o
- A path where you want the salt to be stored using
-s
crypt -p <your-passphrase> -o <output-path> -s <salt-path> encrypt <input-path>
For example:
crypt -p "my super secure passphrase" -o output.enc -s output.salt encrypt mysecretfile.txt
This will generate two new files:
output.enc
, the encrypted fileoutput.salt
, this file is required to decryptoutput.enc
Now you can safely delete the original file ;3
NOTE: To avoid compromising your passphrase, omit -p
or supply an empty string to -p
and crypt
will prompt you to enter your password.
crypt -p "" -o output.enc -s output.salt encrypt mysecretfile.txt
To decrypt, you simply do the inverse of encryption:
crypt -p <your-passphrase> -o <decrypted-output-path> -s <salt-path> decrypt <encrypted-input-file>
Now you should have your original file back ;3
Now you can hide stuff without much hassle X3 thank me later