Skip to content

ammarx/Kleopatra-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🔐 Kleopatra-py

A Terminal User Interface (TUI) for GPG batch decryption and encryption, inspired by the Kleopatra desktop application. Built with Textual and PGPy.

Browse files, select multiple encrypted or plaintext files, enter your passphrase once, and decrypt or encrypt them all in one go — right from your terminal.

Main Page


✨ Features

📁 Interactive File Browser

  • Full directory tree rooted at your home folder
  • Hidden files are filtered out automatically
  • Directories are sorted before files for easy navigation

📋 Batch File Selection

  • Click any file in the browser to add it to the queue
  • Remove individual files with the button or clear the entire list at once
  • Duplicate files are detected and skipped
  • Visual indicators distinguish GPG files (🔒) from regular files (📄)

🔓 Batch Decryption

  • Enter your passphrase once and decrypt all selected files
  • Supports symmetric (passphrase-based) decryption
  • Supports public-key decryption with a private key file (.asc / .gpg)
  • Protected private keys are automatically unlocked with the provided passphrase
  • Recognised GPG extensions: .gpg, .pgp, .asc, .enc
  • Automatically detects system GnuPG (gpg) for significantly faster symmetric decryption
  • Falls back to the pure-Python PGPy implementation when gpg is not installed

🔐 Batch Encryption

  • Encrypt any selected files using a public key or a symmetric passphrase
  • Encrypted output is saved with a .gpg extension

📦 Auto-Extract & Nested Scanning

  • When enabled, archives (.zip, .tar, .tar.gz, .gz) are automatically extracted after decryption
  • Extracted contents are scanned recursively for nested GPG files
  • Discovered GPG files are automatically added to the decryption queue
  • Non-GPG archive files selected directly are extracted first, then their GPG contents are queued for decryption

📂 Custom Output Directory

  • Set a single output directory for all decrypted or encrypted files
  • Browse for the output folder via a built-in directory picker modal
  • Leave blank to output files alongside their sources

🗝 Key File Support

  • Optionally provide a private key file for decryption or a public key file for encryption
  • Browse for the key file using a dedicated file picker modal

📝 Activity Log

  • Real-time timestamped log of all operations
  • Success (✓), failure (✗), and informational messages
  • Clearable with a button or Ctrl+L

⌨️ Keyboard Shortcuts

Shortcut Action
Ctrl+D Decrypt All
Ctrl+E Encrypt All
Ctrl+L Clear Log
Ctrl+Q Quit

🚀 Installation

Prerequisites

  • Python 3.8 or higher

Install Dependencies

pip install -r requirements.txt

Or install manually:

pip install textual>=0.40.0 PGPy>=0.6.0

▶️ Usage

python Kleopatra_py.py

Quick Start

  1. Browse the file tree on the left panel and click files to add them to the queue.
  2. Enter your passphrase in the settings bar (used for all files).
  3. (Optional) Select a private/public key file via the "Browse…" button.
  4. (Optional) Set an output directory or leave blank to use source directories.
  5. Click 🔓 Decrypt All or 🔐 Encrypt All to process the queue.
  6. Monitor progress in the Activity Log at the bottom.

📦 Dependencies

Package Version Purpose
Textual ≥ 0.40.0 Terminal UI framework
PGPy ≥ 0.6.0 Pure-Python OpenPGP implementation

Optional

Package Purpose
GnuPG (system) Faster symmetric decryption when available
PyInstaller (≥ 5.1) Build a standalone .exe

🏗️ Building a Standalone Executable

A one-file .exe can be built with PyInstaller:

pip install pyinstaller
cd Kleopatra-py
pyinstaller --clean --onefile --name Kleopatra_py Kleopatra_py.py --icon icon.ico

Or simply run the included batch file on Windows:

build_exe.bat

The resulting binary will be in the dist/ folder.

About

A Terminal User Interface (TUI) for GPG batch decryption and encryption, inspired by the Kleopatra desktop application.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors