Secure Encryption, Deletion, and Metadata Cleaning Application
This Python application allows you to securely encrypt files and directories using the Fernet library, permanently delete them with the shred command, and clean metadata from various file formats. It is useful for protecting sensitive data and ensuring it cannot be recovered.
Main Features
- Secure Encryption: Uses the Fernet library to encrypt files and directories with a user-provided key.
- Permanent Deletion: Securely removes files and directories using the shred command.
- Metadata Cleaning: Removes metadata from images, documents, PDFs, and multimedia files while preserving file functionality.
- Recursive Processing: Supports encrypting and deleting files within directories recursively.
- User Confirmation Options: Can be configured to require user confirmation before encrypting or deleting files.
Requirements
- Python 3.x
- Required libraries:
cryptography,piexif,pillow,PyPDF2,python-docx,openpyxl,mutagen
Usage
Running cryptshield
Basic syntax:
cryptshield [COMMAND] [OPTION1] [OPTION2]
Examples:
# Encrypt a file
cryptshield encrypt /path/to/file secret_key
# Decrypt a file
cryptshield decrypt /path/to/file.encrypted secret_key
# Encrypt a text
cryptshield encrypt_text "Sample text" secret_key
"gAAAAABnsO0xV07ndDmt-fO..."
# Decrypt a text
cryptshield decrypt_text "gAAAAABnsO0xV07ndDmt-fO..." secret_key
"Sample text"
# Secure file deletion
cryptshield delete /path/to/file
# Clean metadata from files
cryptshield clean_metadata /path/to/image.jpg /path/to/document.pdf
# Clean metadata with essential information preserved
cryptshield clean_metadata /path/to/file.jpg true true true
# Clean metadata without backup (not recommended)
cryptshield clean_metadata /path/to/file.pdf false false true
Metadata Cleaning Feature
The metadata cleaning feature provides secure removal of metadata from various file formats while maintaining the primary functionality of files. This feature complies with DoD 5220.22-M standards for secure deletion.
Supported File Formats
- Images: JPEG, PNG, TIFF, GIF
- Removes: EXIF data, GPS coordinates, camera information, comments, timestamps
- Documents: PDF, DOCX, XLSX, PPTX
- Removes: Author information, creation/modification dates, comments, document properties, edit history
- Multimedia: MP3, MP4, AVI, MOV, WAV, FLAC
- Removes: ID3 tags, artist, album, comments, metadata
- Text Files: TXT, RTF
- Removes: File system metadata where applicable
Metadata Cleaning Options
- preserve_essential (true/false): Whether to preserve essential metadata like title and creator
- backup (true/false): Whether to create backups before cleaning (recommended)
- verify (true/false): Whether to verify metadata removal after cleaning
Security Features
- Secure Backup Management: Creates temporary backups during processing, removes them after successful verification
- Verification Process: Confirms metadata has been successfully removed
- Audit Logging: Detailed logs of all metadata cleaning operations
- DoD 5220.22-M Compliance: Follows secure deletion standards
- Forensic Recovery Prevention: Ensures metadata cannot be recovered
Examples
# Basic metadata cleaning
cryptshield clean_metadata /path/to/photo.jpg
# Clean multiple files
cryptshield clean_metadata /path/to/photo.jpg /path/to/document.pdf /path/to/music.mp3
# Preserve essential metadata (title, creator)
cryptshield clean_metadata /path/to/document.pdf true
# Clean without backup (faster, but less safe)
cryptshield clean_metadata /path/to/file.jpg false
# Full control: preserve_essential=false, backup=true, verify=true
cryptshield clean_metadata /path/to/file.jpg false true true
Release Information
Version 1.1.0
You can download the latest release of the Cryptshield package as a .deb file from the following link:
Download Cryptshield 1.1.0 (.deb)
Installation
To install the package on your system, run the following command:
wget https://github.com/wilmerm/cryptshield/releases/download/v1.1.0/cryptshield_1.1.0_all.deb
sudo dpkg -i cryptshield_1.1.0_all.deb
After installation, you can run the cryptshield command by simply typing:
cryptshield encrypt [FILE] [KEY]
If you encounter any issues with dependencies, you can resolve them using:
sudo apt-get install -f
Setup
Ensure the required libraries are installed using the following command:
pip install -r requirements.txt
If you plan to use secure deletion, make sure you have administrator (sudo) privileges.
Installation and .deb Package Creation
Follow these steps to create and install the .deb package for Cryptshield:
1. Build the Package
Run:
dpkg-buildpackage -us -uc
2. Install and Test
sudo dpkg -i ../cryptshield_<version>_all.deb
cryptshield
If there are dependency issues, fix them with:
sudo apt-get install -f
Building and Publishing the Library
To compile and upload the library to PyPI, follow these steps:
-
Ensure you have the necessary dependencies:
pip install build twine
-
Build the package:
python -m build
-
(Optional) Verify the package:
twine check dist/*
-
Upload the package to PyPI:
python -m twine upload dist/*
Contributing
If you'd like to contribute to this project or report an issue, feel free to open an issue or submit a pull request on GitHub.
License
This application is distributed under the MIT License.
Contribution 💗
If you find value in this project and would like to show your support, please consider making a donation via PayPal:
Your generosity helps us to continue improving and maintaining this project. We appreciate every contribution, however small. Thanks for being part of our community!
Metadata
Release files for cryptshield 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cryptshield-1.1.1.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cryptshield-1.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.6 kB
Release files / cryptshield-1.1.1.tar.gz
| Download URL | cryptshield-1.1.1.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8cbb115b380bd5d6e162526e973347fe0c62f8856f18beab452e34bbc8ad1352
|
|
BLAKE2b-256 checksum How to use checksums |
40b0f52d096919379f69c27048addebac04201f9364072da5af1356add4ff01c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|
Release files / cryptshield-1.1.1-py3-none-any.whl
| Download URL | cryptshield-1.1.1-py3-none-any.whl |
|---|---|
| Size | 16.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f7d0cf3732b1ce30b930cd181d01b37d800d22abc40a0e407bbc396528f7dd98
|
|
BLAKE2b-256 checksum How to use checksums |
44a9fff08aeb8f14a47e57557f56bb916934a1ce785038bca0a6f264885d21cc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.5
|