A Python package for securely encrypting and decrypting files with advanced algorithms.
Project description
Crp Encryption Tool 🔐
Welcome to Pycrp, a simple yet effective command-line tool for encrypting and decrypting files using symmetric encryption
Fernet. This tool is designed to protect your files with a key you provide and securely save or retrieve them from encrypted .crp files.
Features ✨
- Encrypt Files: Secure your files by encrypting them with a key.
- Decrypt Files: Retrieve your encrypted files with the correct key.
- Simple CLI Interface: Use easy-to-remember commands to encrypt or decrypt files in bulk.
Installation ⬇️
To get started:
pip install pycrp
Usage 🚀
This tool provides two main commands: enc to encrypt files and dec to decrypt them.
Encrypt Files 🔒
To encrypt files in a directory, use the enc command:
pycrp enc <key> -d <directory> -ex <export_directory>
<key>: The encryption key.-d <directory>: The directory where the files to encrypt are located. If omitted, it defaults to the current directory.-ex <export_directory>: The directory where the encrypted.crpfiles will be saved. If omitted, it defaults tocrp-files/.
Example:
pycrp enc "my-secret-key" -d ./myfiles -ex ./encrypted-files
Decrypt Files 🔓
To decrypt previously encrypted .crp files, use the dec command:
pycrp dec <key> -d <directory> -ex <export_directory>
<key>: The decryption key (must be the same key used to encrypt the files).-d <directory>: The directory where the.crpfiles are located. Defaults to the current directory if omitted.-ex <export_directory>: The directory where the decrypted files will be saved. Defaults tofiles/.
Example:
pycrp dec "my-secret-key" -d ./encrypted-files -ex ./decrypted-files
Code Overview 🛠️
Crp Class
The Crp class provides all the core functionality:
__init__(key: str): Initializes the encryption/decryption object with a specified key.encrypt( bytes) -> bytes: Encrypts byte data using the Fernet symmetric encryption.decrypt( bytes) -> bytes: Decrypts previously encrypted byte data.load_file(path: str): Loads the file data to prepare it for encryption.dump_crp(file_name: str = None, export_dir_path: str = None): Saves the encrypted data to a.crpfile.load_crp(path: str): Loads and decrypts a.crpfile.dump_file(file_name: str = None, export_dir_path: str = None): Saves the decrypted data to a file.
CLI Commands
enc: Encrypt files in a directory.dec: Decrypt.crpfiles in a directory.
Contributing 🤝
Feel free to open issues and submit pull requests. Contributions are welcome!
License 📄
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pycrp-1.0.0.tar.gz.
File metadata
- Download URL: pycrp-1.0.0.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7331f65bb0bb1259ac4a73d12225fc38d839bddda53deb527a71960482dc11db
|
|
| MD5 |
c52489beb046ca0d68b3222adb57e255
|
|
| BLAKE2b-256 |
84a3770e2ce796db31f2092172f9c5fd8501ba90bf3c2bd34b6cb34f127f601f
|
File details
Details for the file pycrp-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pycrp-1.0.0-py3-none-any.whl
- Upload date:
- Size: 6.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7292fc9729d41eec3b38a3a87008506ba4dd0393c37a2b0a7a5cf9e97394d4a3
|
|
| MD5 |
02ffb745c495243153808a1cdb923bbf
|
|
| BLAKE2b-256 |
b9e48fe5c4dfb3d7268e8677c12d8f6c82bea4b8163dd653020cc9a47d7a57d4
|