No description
Find a file
2026-03-23 07:43:50 -07:00
.gitignore chore: add vim swap files to gitignore 2026-03-23 07:17:48 -07:00
pirc.lua feat: add pirc end-to-end encryption plugin for weechat 2026-03-23 07:43:50 -07:00
README.md docs: add README for PIRC encryption script 2026-03-23 07:43:35 -07:00

PIRC: End-to-End Encryption for IRC

Lua script for WeeChat implementing SMSG protocol as defined in pirc-flow.org.

Features

  • GPG-based encryption for channel messages
  • Key exchange via SMSG-REQ/SMSG-ACK
  • Automatic encryption for trusted users
  • Support for single-operator and zero-operator channels
  • Visible disapproval: undecipherable messages shown as "** Undecipherable nonsense **"

Installation

  1. Ensure GPG is installed and available in PATH.
  2. Copy pirc.lua to WeeChat's Lua scripts directory (usually ~/.weechat/lua/).
  3. In WeeChat, load the script: /script load pirc.lua

Usage

Securing a channel

Join a channel and issue:

/cone-of-silence

This will send your public key to all operators and voiced users in the channel.

Receiving key requests

When someone sends you a SMSG-REQ, the script will automatically import their public key and respond with your public key (auto-approval). The sender will be added to your trusted list.

Sending encrypted messages

Once you have trusted users in a channel, any message you send will be automatically encrypted for all trusted users in that channel. The encrypted message will be sent as a BLOB: prefixed base64 string.

Receiving encrypted messages

Incoming messages with BLOB: prefix will be automatically decrypted and displayed as plain text. If decryption fails (e.g., you don't have the sender's key), you'll see ** Undecipherable nonsense **.

Configuration

Edit the config table at the top of pirc.lua to adjust:

  • data_dir: where GPG keys and state are stored (default: ~/.weechat/pirc/)
  • gpg_bin: path to GPG executable
  • debug: enable debug logging

Protocol Details

The script implements the following SMSG messages:

  • SMSG-REQ <base64 pubkey>: request to join secure channel
  • SMSG-ACK <base64 pubkey>: response with own public key
  • BLOB: <base64 encrypted>: encrypted channel message

Voting for multi-operator channels is not yet implemented; currently auto-approval is used.

Limitations

  • Voting system not implemented (single-operator assumption)
  • No persistence of channel state across restarts (trusted keys are saved)
  • No support for SMSG-VOTE or SMSG-INTRO messages
  • Assumes GPG key generation works non-interactively

Development

Contributions welcome. See pirc-flow.org for full protocol specification.

License

MIT