Git Product home page Git Product logo

zmsg's Introduction

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!

1

2

3

4

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

  1. Clone
git clone https://github.com/publiusfederalist/zmsg
  1. Get the npms
cd zooko-msg
npm install hsd hs-client readline stream hsencrypt consoleinout
  1. Setup your hsd keys folder
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.

  1. 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.

zmsg's People

Contributors

publiusfederalist avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.