- Lua 100%
| .gitignore | ||
| pirc.lua | ||
| README.md | ||
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
- Ensure GPG is installed and available in PATH.
- Copy
pirc.luato WeeChat's Lua scripts directory (usually~/.weechat/lua/). - 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 executabledebug: enable debug logging
Protocol Details
The script implements the following SMSG messages:
SMSG-REQ <base64 pubkey>: request to join secure channelSMSG-ACK <base64 pubkey>: response with own public keyBLOB: <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