Zmsg
Send encrypted messages and decrypt them without sharing keys. Built using the Handshake blockchain.
Install / Use
/learn @publiusfederalist/ZmsgREADME
zmsg
Encrypt and decrypt messages using AEAD with an ephemeral key
Learn more by joining the Handshake Discord Community
I noticed that there wasn't an encrypt/decrypt function natively provided in Handshake, so I built this using concepts introduced earlier in the Bitcoin space. The benefit of this implementation is that it is complete because of Handshake names. Zooko's Triangle is solved with Handshake making crypto better than ever!




How it works
zmsg
Basically, your private key is used in conjunction with the recipient's public key to generate a common key. This common key is ephemeral. Instead, you can simply share the ciphertext. The system uses hsencrypt
Also go on chain
You can also use zmsg-broadcast which is the same as zmsg, except it will put your message on chain. Then, someone can use zmsgpull to pull messages, and then zmsgread to read them.
The benefit of this is that you can encrypt messages and send them. The world will know you encrypted a message and sent it, but it will not know to whom it was for or what it said.
Of course, opponents might have issue with using a chain for this purpose, but I feel the benefits outweight the cons.
Installation Instructions
- Clone
git clone https://github.com/publiusfederalist/zmsg
- Get the npms
cd zooko-msg
npm install hsd hs-client readline stream hsencrypt consoleinout
- Setup your hsd
keysfolder
echo "someapikey" > keys/node
echo "somewalletkey" > keys/wallet
You can get these with hsd. Make sure hsd has all the index-tx, index-address and other options enabled.
- Run commands!
Commands
Encryption
zmsg <wallet> <yourname> <theirname> "<msg>"
Decryption
zmsg <wallet> <theirname> <yourname> <encrypted> d
Blockchain
You can also use zmsg-broadcast which will actually write this to the blockchain.
Copyright
Copyright (c) 2022 Publius Federalist
All Rights Reserved
MIT LICENSED.
Related Skills
node-connect
332.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
332.3kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
81.7kCommit, push, and open a PR
