Skip to main content
PyPI release Downloads per month Translate this project Banner

Module ID: blueset.gpg

A middleware for EH Forwarder Bot that encrypts and decrypts messages using GnuPG.

This middleware simply encrypts outgoing messages with recipients’ registered public key, and decrypt incoming messages with your own secret key.

All encrypted messages should be and will be ASCII armored. All messages that was not successfully encrypted/decrypted will be delivered untouched.

This middleware only encrypt/decrypt text messages. Other types of messages are kept untouched.

Dependencies

  • EH Forwarder Bot >=2.0

  • GnuPG

  • An imported key pair that is used to decrypt incoming messages

Getting Started

  1. Make sure you have access to a public key server of your choice using the gpg installed.

  2. Have at least one key pair registered in local GPG.

  3. Install this middleware:

    pip3 install efb-gpg-middleware
  4. Create a config file in your current EFB profile: <PATH_TO_EFB_PROFILE>/blueset.gpg/config.yaml:

    # Signature of your own key pair (required)
    key: BD6B65EC00638DC9083781D5D4B65BB1A106200A
    
    # Passphrase to the key pair (optional)
    password: test
    
    # Trust all key in the local stoage
    # (optional, default: true)
    always_trust: true
    
    # Path to the GPG binary
    # (optional, default: search from $PATH)
    binary: /usr/bin/gpg
    
    # Preferred public key server
    # (optional, default: pgp.mit.edu)
    server: pgp.mit.edu

How to use

Send commands as text messages in chats to interact with the middleware. All command messages will not be delivered to slave channel.

  • gpg`info or gpg`show: Show the key fingerprint used for this chat.

  • gpg`search query: Search for a key from the key server.

  • gpg`bind fingerprinthex: Use key for specified fingerprint for a chat.

  • gpg`clear: Do not encrypt messages sent to this chat.

When you have told the middleware to use a key for a chat, it will encrypt all your text messages sent to this chat with the key specified.

The middleware will try to decrypt all incoming text messages with GnuPG regardless of settings, and only update the message if the decryption is successful.

Footnote

If you find this module not as useful, don’t be disappointed. This is just a demo to show you what you can do with EFB Middlewares.

Experimental localization support

GPG Middleware supports localized user interface prompts experimentally, by setting the locale environmental variable (LANGUAGE, LC_ALL, LC_MESSAGES or LANG) to one of our supported languages. Meanwhile, you can help to translate this project into your languages on our Crowdin page.

Metadata

Release files for efb-gpg-middleware 1.1.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 efb-gpg-middleware 1.1.1
File Size Uploaded
efb-gpg-middleware-1.1.1.tar.gz 13.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for efb-gpg-middleware 1.1.1
File Interpreter ABI Platform
efb_gpg_middleware-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 49.7 kB

Release files / efb-gpg-middleware-1.1.1.tar.gz

Download URL efb-gpg-middleware-1.1.1.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
fb3b5cf84d0d91b07dee3b8a21ec3382030093b95f7ee43f9260a0140a4af440
BLAKE2b-256 checksum
How to use checksums
966c1e5fc2d8284fe8e7b4a68339bc78464bebc6c4cbabf56c2504ed22ae73a2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.5

Release files / efb_gpg_middleware-1.1.1-py3-none-any.whl

Download URL efb_gpg_middleware-1.1.1-py3-none-any.whl
Size 36.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b1e7352eb74068986ed8fddab5a3ad84c31b2960cbedcde2062a1c2e54391922
BLAKE2b-256 checksum
How to use checksums
4bf385de49549c19e9d6ff5524734aab026206405e81618b765d1389d7fbbaab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.9.5
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