UNPKG

shh-client

Version:

The Shh.. protocol v0.0.1 Beta Tested. Keeps your messages very secure. Currently in more testing and securty.

25 lines (20 loc) 686 B
# shh-protocol client Shh.. _!_ The protocol keeps it silent... No one can read, listen or watch it. ## Get started ### Generate client keys ```js // 1. Generate key pairs let pawanPriv = generateKey('private'); let pawanPub = derivePublicKey(pawanPriv); let friendPriv = generateKey('private'); let friendPub = derivePublicKey(friendPriv); let pawanSharedKey = generateSharedKey(pawanPriv, friendPub); let friendSharedKey = generateSharedKey(friendPriv, pawanPub); // 3. Prepare encrypted message const message = { content: "Hello, It's Shh.. Chat!" }; let encryptedMsg = enc(message, pawanSharedKey); // 4. Send to server toServer(`/sh/users/${friendPub}`, encryptedMsg); ```