Skip to main content

GhostBytes

Ghostbytes is a desktop-based user-friendly file encryption and data security utility implmented in python. It features symmetrical, asymmetrical (public / private key), and post-quantum cryptography designs through an intuitive graphical user interface (GUI).

Screenshot on img/home.png

Aim

The goal of this project is to introduce everyday users and beginner developers to the fundamentals of cryptography, data privacy, confidentiality in file sharing.

In today's digital world, privacy isn't just for tech experts. it’s something everyone deserves. This repository aims to break down complex security concepts into simple, practical examples so anyone (even if you just learned your first lines of Python!) can understand how online privacy works and why it matters.

Features

Ghostbytes implemented a range of security features ranging from encryption, key management, hashing, to cryptographical randomness and secure deletion. Core features of the program is listed below:

  • 🔒 AES-256 GCM Mode Encryption with Authentication Tag (Integrity and Confidentiality): Encrypt files while providing integrity verification and authenticated encryption.
  • 🔒 RSA Asymmetric Encryption / ML-KEM Post-Quantum Cryptography: The Module-Lattice-Based Key-Encapsulation Mechanism is implemented as one of the asymmetric encryption options along with RSA.
  • 🔒 Envelope-Based Asymmetric Encryption: Plaintext is encrypted using AES-256-GCM with a symmetric master key, which is then encapsulated and protected using asymmetric encryption to eliminate the message-size limitations of direct asymmetric encryption. (See docs/cryptography.md for more details)
  • 🔑 Generate, Verify, and View RSA / ML-KEM / ML-DSA Keys: Encryption keys and post-quantum signature keys can be generated, inspected, and verified within the program.
  • ✍️ RSA-PSS and ML-DSA Signatures: Create and verify detached signatures for files using RSA or ML-DSA. ML-DSA-44, ML-DSA-65, and ML-DSA-87 are supported.
  • # Fully-Featured Hashing Toolkit: Major hashing algorithms (SHA256, SHA512, SHA3_256, SHA3_512, BLAKE2b, BLAKE2s, and md5) are implemented with an extension feature to copy output to checksum file.
  • 🎲 Random Number Generator (with multiple random sources): Ghostbytes also features a function to generate passwords and random data from multiple random sources.
  • 🗑️ Secure Delete (File Shredding): Secure delete or file shredding is implemented with multiple overwrite patterns (including random, zero, one, and gutmann)

Supported / Used Algorithms

Name Description Library Implementation
AES-256-GCM Authenticated symmetric encryption providing confidentiality and integrity verification. PyCryptodome (Crypto.Cipher.AES) Implemented by aes_encrypt() and aes_decrypt() in primitives.py. A 32-byte key is used for AES-256, with the nonce and authentication tag stored in the ciphertext envelope.
RSA-OAEP Asymmetric encryption using an RSA public key for encryption and private key for decryption. PyCryptodome (Crypto.Cipher.PKCS1_OAEP, Crypto.PublicKey.RSA) Implemented by rsa_oaep_encrypt() and rsa_oaep_decrypt() in primitives.py.
Hybrid RSA-OAEP Encrypts file data with AES-256-GCM and protects the AES key using RSA-OAEP, avoiding RSA message-size limitations. PyCryptodome and Argon2id Implemented in oaep_extension.py. A random 32-byte seed is generated for each message, derived into an AES-256 key with Argon2id, and wrapped with RSA-OAEP.
ML-KEM-768 Post-quantum key-encapsulation mechanism offering NIST Security Category 3 protection. cryptography (cryptography.hazmat.primitives.asymmetric.mlkem) Key generation, encapsulation, decapsulation, and hybrid AES encryption are implemented in kyber.py.
ML-KEM-1024 Post-quantum key-encapsulation mechanism offering NIST Security Category 5 protection. cryptography Supported alongside ML-KEM-768 through the algorithm mapping in kyber.py.
RSA-PSS RSA probabilistic digital signature scheme for detached signatures. PyCryptodome (Crypto.Signature.pss) Implemented by rsa_sign() and rsa_verify() in primitives.py.
ML-DSA-44 / 65 / 87 Post-quantum digital signature algorithm standardized by FIPS 204. cryptography (cryptography.hazmat.primitives.asymmetric.mldsa) Key generation, signing, verification, and serialization are implemented in dilithium.py.
Argon2id Memory-hard password-based key derivation function used to derive 256-bit encryption keys. argon2-cffi (argon2.low_level) Implemented by derive_key() in primitives.py, using configurable salt, time cost, memory cost, and parallelism.
SHA-256 Secure cryptographic hash function producing a 256-bit digest. PyCryptodome (Crypto.Hash.SHA256) Registered in config.py and used by the file hashing and benchmarking tools.
SHA-512 Secure cryptographic hash function producing a 512-bit digest. PyCryptodome (Crypto.Hash.SHA512) Registered in config.py and used by the file hashing and benchmarking tools.
SHA3-256 SHA-3 cryptographic hash function producing a 256-bit digest. PyCryptodome (Crypto.Hash.SHA3_256) Registered in config.py.
SHA3-512 SHA-3 cryptographic hash function producing a 512-bit digest. PyCryptodome (Crypto.Hash.SHA3_512) Registered in config.py.
BLAKE2b High-performance cryptographic hash function optimized for 64-bit platforms. PyCryptodome (Crypto.Hash.BLAKE2b) Registered in config.py.
BLAKE2s BLAKE2 hash function optimized for smaller platforms and 32-bit systems. PyCryptodome (Crypto.Hash.BLAKE2s) Registered in config.py.
MD5 Legacy 128-bit hash function provided for compatibility and checksums. It is not suitable for security-sensitive integrity purposes. Python standard library (hashlib) Imported and registered in config.py.
os.urandom Operating-system random byte generator. Python standard library (os) Implemented in rand.py.
PyCryptodome random Random byte generator provided by PyCryptodome. PyCryptodome (Crypto.Random) Implemented using get_random_bytes() in rand.py.
Python secrets Cryptographically secure random byte generator intended for security-sensitive data. Python standard library (secrets) Implemented using token_bytes() in rand.py.
Python random General-purpose pseudo-random byte generator. Python standard library (random) Implemented using randbytes() in rand.py. This should not be used where cryptographic security is required.
/dev/urandom Unix operating-system random byte device that does not block waiting for additional entropy. Unix device accessed through Python subprocess Read through the head command in rand.py.
/dev/random Unix operating-system random byte device that may block while collecting entropy. Unix device accessed through Python subprocess Read through the head command in rand.py.
Random overwrite Overwrites file contents with random data. Ghostbytes implementation using configured random sources Implemented by overwrite_random() in shred.py.
Zero overwrite Overwrites file contents with zero bytes. Ghostbytes implementation Implemented by overwrite_pattern() and selected through shred_file() in shred.py.
One overwrite Overwrites file contents with 0xFF bytes. Ghostbytes implementation Implemented by overwrite_pattern() and selected through shred_file() in shred.py.
Gutmann overwrite Uses the traditional multi-pass Gutmann overwrite pattern. Ghostbytes implementation The 32-pass pattern is defined by GUTMANN_PATTERN and applied by overwrite_gutmann() in shred.py.

Requirements

This project uses Uv as the main python package and project manager. In Uv, you can install the project dependencies via the following command:

uv sync

To run code instantly, use this command instead (it automatically triggers a sync before running the code):

uv run ghostbytes

Quick Start / Installation

  1. Install uv (either in a virtual environment or globally on your system) (if you haven't already):
pip install uv
  1. Clone the repository:
git clone https://github.com/maxttkam/ghostbytes.git
  1. Sync the project dependencies:
uv sync

For development, use:

uv sync --group dev
  1. Run code directly:
uv run ghostbytes
  1. (optional) Install and configure PATH environment variable:
uv tool install
uv tool update-shell

Security Notes

GhostBytes uses established cryptographic primitives, but correct security depends on configuration, key handling, and operational practices.

Important Considerations:

  • The encryptor and decryptor must use the same configuration, including the salt, for decryption to succeed.
  • Hybrid RSA-OAEP also depends on the matching KDF settings (kdf_salt, time cost, memory cost, and parallelism), because the random AES key seed is derived with Argon2id before it is wrapped with RSA-OAEP.
  • Use a preferably unique salt (in advanced settings) for each encryption (if applicable) and keep it with the encrypted data or configuration. Unique salts make precomputed rainbow table attacks more difficult.
  • Configuration can be exported to and imported from a .conf file. Use Generate Config (Random Salt) to automatically create a salt from random bytes, then export the configuration so the same settings can be used by the encryptor and decryptor.
  • Protect passwords, private keys, and configuration files from unauthorized access.
  • Keep backups of important private keys and recovery information.
  • Sensitive data, passwords, or keys may be exposed by malware, debugging tools, or memory extraction.
  • Use trusted devices and secure environments when handling sensitive information.

Limitations

  • RSA key generation above 4096 bits may take significant time due to expensive prime generation operations.
  • Python runtime overhead can make CPU-intensive cryptographic operations slower than equivalent lower-level implementations.
  • Performance varies depending on hardware and cryptographic backend.

For operations that require speed (if you are a professional and you know what you are doing), consider the following alternatives instead:

VeraCrypt

OpenSSL

Release files for ghostbytes 1.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ghostbytes 1.1.3
File Size Uploaded
ghostbytes-1.1.3.tar.gz 57.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ghostbytes 1.1.3
File Interpreter ABI Platform
ghostbytes-1.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 120.9 kB

Release files / ghostbytes-1.1.3.tar.gz

Download URL ghostbytes-1.1.3.tar.gz
Size 57.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ae7051228f8f53ba90b98c4e1137ca5e353f0f141c28f4cdf2788c8c1e1fc5ba
BLAKE2b-256 checksum
How to use checksums
ccf72925bca1305e322ea8f1659188f2e3e7eac26480064026f13d0d7b7b46cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release files / ghostbytes-1.1.3-py3-none-any.whl

Download URL ghostbytes-1.1.3-py3-none-any.whl
Size 63.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2d8c95ae540b8623d94e651714fcb98934516326e5d788747243a210162c2a9e
BLAKE2b-256 checksum
How to use checksums
c159446e7729ab3ef61511ea51bc6e4bf339db2b3b54278a63cec8c1ae82eb95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.1.3 This release

2 release files

1.1.2

2 release files

1.1.0

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page