A CLI for encrypting and decrypting files and folders using AES encryption.
Nyancrypt uses the built-in crypto module in Node.js to encrypt files using 256-bit AES-CTR encryption, using a generated key. You should store the key separately from your encrypted files in a secure place.
The basic syntax is nyancrypt [action] [path]
. You can also use the nyan
command instead of nyancrypt
.
The various actions are:
This generates a new encryption key. You will be prompted to name this key. The key name is used to identify this key if you choose to use multiple keys for different files. Specify an output folder in path
. Remember to store this key securely.
Example: nyancrypt gen-key ./keys
Specify a key file to make Nyancrypt use this key when encrypting or decrypting files. Nyancrypt will remember this key path until you run this command again.
Example: nyancrypt use ./mykey-nyancrypt-config.json
Encrypts a file or folder specified in path
. The encrypted file will have a masked filename. If you specify a folder, all plaintext files in the folder will be encrypted.
Example: nyancrypt encrypt ./my_secret_file.pdf
The reverse of the encrypt
command: decrypts a file and restores the original filename. If you specify a folder, all encrypted files will be decrypted.
Example: nyancrypt decrypt .
Checks a file specified in path
and encrypts it if it's a plaintext file, or decrypts it if it's encrypted. You cannot specify a folder in path
when using this command.
Example: nyancrypt nom ./my_secret_file.pdf
Lists the original filenames of any encrypted files in the folder specified in path
. If an encrypted file is specified in path
the original filename of that file is shown.
Example: nyancrypt ls .