This repository contains a small Streamlit app that demonstrates signing files (detached ASCII-armored signatures) and verifying signatures using PGP keys already present in your GPG keyring.
Files added:
app.py— Streamlit app with two tabs: Sign and Verify.gnupg_utils.py— small wrapper aroundpython-gnupgfor listing keys, signing and verification.requirements.txt— Python dependencies.
- Python 3.14 (see below for setup)
- GnuPG installed on your machine (the
gpgbinary). On macOS you can run:
brew install gnupg- PGP keys must be generated or imported using the terminal (
gpgCLI) before using this app.
Install Python dependencies:
python3.14 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtRun the Streamlit app:
streamlit run app.pyGenerate a keypair with gpg CLI:
gpg --full-generate-key
# follow the prompts (choose an RSA key, size 2048 or 4096, enter name/email and a passphrase)Import an existing private key:
gpg --import private.ascImport a public key:
gpg --import public.ascList keys in your keyring:
gpg --list-secret-keys
gpg --list-keysExport public key (for sharing):
gpg --armor --export "Your Name <[email protected]>" > public.ascExport private key (for backup, keep safe!):
gpg --armor --export-secret-keys "Your Name <[email protected]>" > private.ascThis app writes uploaded files and signatures to temporary files to interact with the local gpg installation. Do not run it on untrusted networks if you are using real private keys without additional safeguards.
- The app uses the system GnuPG (so GPG must be installed).
- The
python-gnupglibrary wraps gpg and interacts with a local keyring; behavior may vary depending on gpg version and configuration.
If you want, I can:
- Add an option to run a private GPG home inside the app (isolated keyring).
- Add unit tests for the helper functions.
- Provide a Dockerfile that contains GnuPG and runs the Streamlit app.
This project is intended to run on Python 3.14. To help ensure that environment:
pyproject.tomlincludesrequires-python = ">=3.14,<3.15".- A
.python-versionfile is included with3.14.0forpyenvusers.
Installation suggestions (macOS):
- Install
pyenv(if not installed):
brew install pyenv- Install Python 3.14 using pyenv and set it for the project:
pyenv install 3.14.0
pyenv local 3.14.0Alternatively, if you prefer Homebrew and a bottle is available:
brew install [email protected]
# then use the full path or update PATH to point to the installed python3.14- Recreate the virtualenv with Python 3.14 and install deps:
python3.14 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtIf you want, I can add a Dockerfile that installs Python 3.14 and GnuPG so the environment is reproducible.