Mr Crypter is a command-line tool built using Python's Typer
framework to provide encryption and decryption functionalities.
With Mr Crypter, users can securely encrypt and decrypt files using a password-based approach, as well as manage encrypted files conveniently.
- File Encryption: Encrypt files with a password for added security.
- File Decryption: Decrypt encrypted files with the same password.
- Read Encrypted Files: Temporarily decrypt and view file content without altering the original
- List Encrypted Files: Display a list of all files encrypted by Mr Crypter.
- Search Encrypted Files: Search through encrypted files by filename or shortcut.
- Built-in Help: Comprehensive help system with detailed command information.
-
Clone the repository or copy the
main.py
file to your project directory. -
Install the required dependencies by running:
pip install -r requirements.txt
-
Make sure to have
Python 3.7
or above installed.
Use the install.sh
script if you want easy installation. And make it available from anywhere.
./install.sh
Use the install.py
script if you want easy installation. And make it available from anywhere.
python install.py
After installation, you can use mr-crypter
[COMMAND] from anywhere.
Certain commands require a password to be set before they can be used like the clear-log
command. Run mr-crypter clear-log
to set it up, the first time you run it you will be asked to set a password.
Mr Crypter includes a comprehensive help system. You can access it in two ways:
# Show all available commands and general help
mr-crypter help
# Get detailed help for a specific command
mr-crypter help COMMAND
For example:
mr-crypter help encrypt
Below are the commands available with Mr Crypter:
Encrypt a specified file and log its details.
mr-crypter encrypt FILE_PATH
Decrypt a previously encrypted file.
mr-crypter decrypt FILE_PATH
mr-crypter decrypt SHORTCUT
Read and display the content of an encrypted file without modifying it.
mr-crypter view FILE_PATH [--lines NUMBER]
mr-crypter view SHORTCUT [--lines NUMBER]
Options:
--lines
,-n
: Number of lines to display (optional)
Examples:
# View entire file
mr-crypter view document.txt
# View first 10 lines only
mr-crypter view document.txt --lines 10
# View first 5 lines using shortcut
mr-crypter view doc_shortcut -n 5
mr-crypter insert FILE_PATH "New content to add"
mr-crypter insert SHORTCUT "New content to add"
Display all files encrypted using Mr Crypter.
mr-crypter list-files
mr-crypter clear-log
Search through encrypted files by filename or shortcut.
mr-crypter search SEARCH_TERM
Options:
--shortcuts/--no-shortcuts
: Include or exclude shortcuts in search (default: include)--case-sensitive
: Make search case-sensitive (default: case-insensitive)
Examples:
# Basic search
mr-crypter search document
# Case-sensitive search
mr-crypter search PDF --case-sensitive
# Search only in filenames (exclude shortcuts)
mr-crypter search report --no-shortcuts
Mr Crypter uses the following configuration files and directories to manage encryption:
- Configuration Directory:
~/.file_encryptor/
- Salt File:
salt.key
- Stores the salt used for key derivation - Encrypted Files Log:
encrypted_files.csv
- Logs all encrypted files - Log File:
file_encryptor.log
- Stores error logs
- Your password is never stored; only a salt for key derivation is kept
- Each file has its own verification tag for integrity checking
- Keys are derived on-demand and immediately cleared from memory
- Use a strong password to enhance security
Encrypt a file:
mr-crypter encrypt ~/Documents/sample.txt
Decrypt the same file:
mr-crypter decrypt ~/Documents/sample.txt
Get help on encryption:
mr-crypter help encrypt
This project is licensed under the MIT License - see the LICENSE file for details.