A python cli app to encrypt and decrypt files.
Warning
This will encrypt your files and you may not be able to recover them.
-
Clone the repo
-
Create and activate a virtual environment
python -m venv venv
source venv/bin/activate
- Install the dependencies
pip install --upgrade pip
pip install -r requirements/base.txt
-
Please use this with caution as you may fail to recover your files if you say forget your password or misplace the
FolderKey.key
. -
Read through the code to get an understanding of what is being done before using.
-
Don't try to encrypt large files due to Fernet limitations.
Flag | Description |
---|---|
action | Choose to either encrypt or decrypt . Example: bannin encrypt |
-f --filepath |
This indicates the file you wish to encrypt or decrypt. This flag is given priority over --dir and --filename if all are provided. |
-d --dir |
This indicated the directory whose files you wish to encrypt or decrypt. This does not encrypt or decrypt files in sub-directories. If no directory is provided it uses the --filepath base directory or the current working directory. |
-F --filename |
This indicates the file name to encrypt or decrypt. If --dir is not set, it uses the current working directory. |
-s --saltpath |
This indicates the path to the file that contains the salt value. The file must return 32 url-safe base64-encoded bytes. This is given priority over --salt-filename if both are provided. |
-S --salt-filename |
This indicates the name of the file that contains the salt value. During encryption the salt file will be named this. During decryption this checks the --dir for the file.This defaults to FolderKey.key |
-e --extensions |
This indicates the file extensions to encrypt in a directory. These are comma separated: .txt,.zip,.mp3 . |
-
Run all Getting Started steps.
-
Now install bannin from pip
pip install -e .
- Switch to
safe_space
directory to test out the app.
cd safe_space
bannin encrypt -F sample.txt
bannin decrypt --dir ./sample