Skip to main content

Secure Encryption and Deletion Application

Project description

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

  1. preserve_essential (true/false): Whether to preserve essential metadata like title and creator
  2. backup (true/false): Whether to create backups before cleaning (recommended)
  3. 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:

  1. Ensure you have the necessary dependencies:

    pip install build twine
    
  2. Build the package:

    python -m build
    
  3. (Optional) Verify the package:

    twine check dist/*
    
  4. 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:

Donate on 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!

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

cryptshield-1.1.1.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

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

cryptshield-1.1.1-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file cryptshield-1.1.1.tar.gz.

File metadata

  • Download URL: cryptshield-1.1.1.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cryptshield-1.1.1.tar.gz
Algorithm Hash digest
SHA256 8cbb115b380bd5d6e162526e973347fe0c62f8856f18beab452e34bbc8ad1352
MD5 db7f80515a6499964741bbf55ee8d427
BLAKE2b-256 40b0f52d096919379f69c27048addebac04201f9364072da5af1356add4ff01c

See more details on using hashes here.

File details

Details for the file cryptshield-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: cryptshield-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for cryptshield-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7d0cf3732b1ce30b930cd181d01b37d800d22abc40a0e407bbc396528f7dd98
MD5 2ebde1e60ce766edf8de580a52c464fc
BLAKE2b-256 44a9fff08aeb8f14a47e57557f56bb916934a1ce785038bca0a6f264885d21cc

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