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 Key Pair: Both asymmetric encryption algorithms (ML-KEM and RSA) have a key-generation function within the program. The key information can also be viewed and verified.
  • # 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 Implemented in oaep_extension.py. A random AES-256 key is generated for each message 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.
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 random.py.
PyCryptodome random Random byte generator provided by PyCryptodome. PyCryptodome (Crypto.Random) Implemented using get_random_bytes() in random.py.
Python secrets Cryptographically secure random byte generator intended for security-sensitive data. Python standard library (secrets) Implemented using token_bytes() in random.py.
Python random General-purpose pseudo-random byte generator. Python standard library (random) Implemented using randbytes() in random.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 random.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 random.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.
  • 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.0.1

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.0.1
File Size Uploaded
ghostbytes-1.0.1.tar.gz 53.6 kB Details

Built distribution (wheel)

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

Total release size: 113.2 kB

Release files / ghostbytes-1.0.1.tar.gz

Download URL ghostbytes-1.0.1.tar.gz
Size 53.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7efc12a637b96438a80dca59f9be5a3753ee3742b1acfaa375a937d0a18dc9d7
BLAKE2b-256 checksum
How to use checksums
3aeb5d94952e6419df783b658258f3ab398c6871822cc4ccd8ced913f6c30eaa
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 21, 2026.

Transparency log

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

Download URL ghostbytes-1.0.1-py3-none-any.whl
Size 59.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1807afd72a211cfe3cee347379bd4857198e711855989d0973809eb2d448abbf
BLAKE2b-256 checksum
How to use checksums
34eaed49d5e505fe211e9cd2d23639c6deddbaf0282a86bbfa6e4669fb1a7c1b
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 21, 2026.

Transparency log

Release history Release notifications | RSS feed

1.1.2

2 release files

1.1.0

2 release files

This release

1.0.1 This release

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