Skip to main content

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 .crp files will be saved. If omitted, it defaults to crp-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 .crp files are located. Defaults to the current directory if omitted.
  • -ex <export_directory>: The directory where the decrypted files will be saved. Defaults to files/.

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 .crp file.
  • load_crp(path: str): Loads and decrypts a .crp file.
  • 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 .crp files 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycrp-1.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pycrp-1.0.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file pycrp-1.0.1.tar.gz.

File metadata

  • Download URL: pycrp-1.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.0

File hashes

Hashes for pycrp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 eed28a9aa5963965912e5137b9daa16be403d317e0907944adaf4c29e125e2ad
MD5 b2bcf47c32db97a1a0798cbde3e9531b
BLAKE2b-256 ea7b9d9567d56b003a471fe79f983669f1d86afb68fc5cc54e24c8725006e84b

See more details on using hashes here.

File details

Details for the file pycrp-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pycrp-1.0.1-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

Hashes for pycrp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 32ac81e371eb7b69205844b4105afd4eac596fa976de4ff5237436ccc19f2418
MD5 ca7fec4c0258fae464305194a7c0d065
BLAKE2b-256 caf0dd2cda95d59d7c9e64c2106bbba481ec19f4574427a0115871c23fa0f65e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page