Utility script written in Bash to encrypt/decrypt file(s) or folder(s) using opensource gpg encryption
.
- Recursively encrypt/decrypt folder content or single file.
- Allow intractive and script (silent) mode to be called from other scripts.
- Supports folder archiving using
tar
. - Allow password files over the network.
- Compatible with Windows/Mac/Linux.
By simply giving a folder or file location as the only parameter, you can start the intractive shell which obtain input from the user.
efc /home/user/secret/
By passing valid parameters, you can start the efc utility. Useful when calling inside another script or from another application.
efc -s /home/user/secret/ -t e -p https://file.io/7rSEmRMLB0B6 -d yes -z no
Option | Description | Example | Default |
---|---|---|---|
-s | source file/folder to encrypt/decrypt | test/file.sec | N/A |
-o | output file name or folder location | test/file.sec.gpg | N/A |
-t | task to perform either encrypt or decrypt | e / d | N/A |
-p | file path or URL to a remote file containing the passphrase for the operation (only 1st line will be read) MAX 100 chars | pass.txt / https://file.io/7rSEmRMLB0B6 | N/A |
-d | delete the source file once the task is completed | yes | no |
-z | when encrypting compress the subfolders | no | no |
Use the files inside the test
folder.
efc test/test_data
efc -s test/test_data -t e -p test/password.txt -d yes -z no
efc -s test/test_data/ -o test/output_folder -t e -p test/local.passphrase.txt -d yes -z no
efc -s test/output_folder -o test/test_data/ -t d -p test/local.passphrase.txt -d yes -z no
efc -s test/test_data/ -o test/output_folder -t e -p https://raw.githubusercontent.com/compilable/efc/main/test/local.passphrase.txt -d yes -z no
efc -s test/output_folder/ -o test/test_data -t d -p https://raw.githubusercontent.com/compilable/efc/main/test/local.passphrase.txt -d yes
Need to install the Git for Windows
which provides a BASH emulation that comes with GnuPG pre-installed.
- Create a bash profile.
nano ~/.profile
or
vim ~/.profile
- Create a path variable named
EFC_PATH
pointing to the the EFC source location and append to thePATH
variable:
export EFC_PATH="LOCATION_TO_SOURCE_FOLDER"
export PATH=$PATH:$EFC_PATH
-
Close and open a new bash shell.
-
Check how to use the program by running
efc --help
on a gitbash terminal.
- gpg (GnuPG) [2.2.19, 2.2.27]
- libgcrypt [1.8.5 , 1.9.2]
- tar (GNU tar) [1.34]
- MIT license (MIT)