Encrypted messaging for IRC channels and private queries using modern cryptography.
- Identity (signature): Ed25519
- Key exchange: X25519 (Diffie-Hellman)
- Encryption: XChaCha20-Poly1305 (AEAD)
- Base64: URL-safe, no padding (JSON-friendly)
- Key persistence: optional (DPAPI or password-encrypted store)
- Visual Studio 2026 (v145 toolset)
- libsodium 1.0.20 (already in
libsodium/)
MSBuild e2e.vcxproj /p:Configuration=Release /p:Platform=Win32Or simply:
build.batImportant: mIRC is 32-bit only, so you must build Win32.
copy_to_mirc.bat copies e2e.dll and e2e.mrc into C:\mIRC\.
/load -rs C:\mIRC\e2e.mrc
- Share or request a DM key:
/sharekey <nick> /requestkey <nick> - When you receive
!enc-offer, accept or reject:/enc-accept <nick> /enc-reject <nick> - Send encrypted DM:
/encmsg <nick> <message> - Optional auto-encrypt for a DM:
/dmenc-on <nick> /dmenc-off <nick>
New: Use /e2e <message> to send encrypted messages in any channel or query window.
/e2e This message will be encrypted
/e2e help
Behavior:
- In channel: Sends encrypted message using channel key (if available)
- In query: Sends encrypted DM using shared key (if available)
- No key: Shows helpful error with instructions on how to get a key
- Never sends plaintext: If no key exists, message is NOT sent
- Help:
/e2e helpdisplays all available E2E commands
Examples:
# In a channel window:
/e2e Secret meeting at 3pm
# In a query window:
/e2e Your password is hunter2
# Show all E2E commands:
/e2e help
# If no key exists, you'll see:
[E2E] No channel key for #secret
[E2E] To get a channel key:
[E2E] 1. Generate: /chankey generate
[E2E] 2. Request from user: /chankey request <nick>
You can persist keys securely using DPAPI or a password-encrypted store.
/e2e-persist off
/e2e-persist dpapi
/e2e-persist password
/e2e-setpass <password>
/e2e-save
/e2e-load
- DPAPI: automatic per-Windows-user encryption, no password needed.
- Password: requires
/e2e-setpasseach session to load/save. - Keys are stored in
C:\mIRC\e2e_store.hsh(encrypted).
- Generate a channel key (from inside the channel):
/chankey generate - Share the key (DM) or request it:
Outside a channel:
/chankey share <nick> /chankey request <nick>/chankey share <#chan> <nick> /chankey request <#chan> <nick> - Send encrypted channel message:
/chankey send <message> - Optional auto-encrypt for a channel:
/chanenc-on [#chan] /chanenc-off [#chan]
- Channel window -> E2E Encryption:
- Share/Request DM Key
- Generate/Share/Request Channel Key
- Send Encrypted Message
- Enable/Disable Auto Encrypt
- Storage options (persistence mode, set password, save/load)
- Query window -> E2E Encryption:
- Share/Request DM Key
- Send Encrypted Message
- Enable/Disable DM Auto Encrypt
- Storage options (persistence mode, set password, save/load)
- Nick list (right-click on user in channel) -> E2E Encryption:
- DM Key Management:
- Share DM Key
- Request DM Key
- Send Encrypted DM
- Enable/Disable DM Auto-Encrypt
- Channel Key Management:
- Share Channel Key
- Request Channel Key
- DM Key Management:
- User list (right-click on user) -> E2E Encryption:
- DM Key Management:
- Share DM Key
- Request DM Key
- Send Encrypted DM
- Enable/Disable DM Auto-Encrypt
- Channel Key Management:
- Share Channel Key
- Request Channel Key
- DM Key Management:
!enc-offer {"v":1,"idPub":"...","encPub":"...","sig":"..."}
sigis a signature overencPubusing Ed25519.
!enc-msg {"v":1,"from":"<encPub>","nonce":"...","cipher":"..."}
!chanenc-key {"v":1,"channel":"#chan","network":"NetworkName","key":"...","createdAt":123}
!chanenc-msg {"v":1,"nonce":"...","cipher":"..."}
| Function | Input | Output |
|---|---|---|
GenKeys |
0 |
`idPub |
CreateOffer |
`idPub | encPub |
DeriveSecret |
`idPub | encPub |
EncryptDM |
`key | myEncPub |
DecryptDM |
`key | nonce |
GenChanKey |
0 |
key (base64) |
EncryptChan |
`key | plaintext` |
DecryptChan |
`key | nonce |
StoreEncrypt |
`mode | password |
StoreDecrypt |
`mode | password |
Version |
0 |
Version string |
- Authenticated encryption (AEAD)
- Signature verification (Ed25519)
- Random nonces per message
- libsodium (audited, widely used)
- No perfect forward secrecy (no ratcheting)
- Keys live in memory only (no persistence)
- Encrypted persistence is optional (DPAPI or password)
- Channel key is shared by all users in the channel
- No replay protection
The DLL and script write diagnostic lines to:
C:\mIRC\e2e.logs
This includes load/self-test results and any DLL error returns. Use this file when reporting crashes or unexpected errors.
//echo -a $dll(e2e.dll, Version, 0)
If it returns empty:
- Ensure
e2e.dllis inC:\mIRC\ - Ensure Win32 build
- Reload:
/dll -u e2e.dllthen/load -rs e2e.mrc
- Confirm you exchanged DM keys (offer + accept)
- Confirm the channel key exists (
/chankey generateor received via!chanenc-key) - For auto-encrypt, verify it is enabled
e2e.c - Main DLL (test functions)
e2e_keyex.c - Key exchange and crypto functions
e2e.def - Export list
e2e.mrc - mIRC script
e2e.vcxproj - Visual Studio project
libsodium/ - Crypto library
Open source for educational use. Uses libsodium (ISC license).
Disclaimer: Experimental code, use at your own risk.