real-chat
multiparty encrypted chat. a wrapper around private-box.
install
npm install real-chat
use
var real = var alice = realvar bob = realvar msg = "hello" // encrypt + decryptvar ciphertext = realvar cleartext = realconsole// "hello"
api
real.keypair()
generate ed25519 keypair
real.encrypt(string, [publicKeys...], [maxRecipients=7])
encrypt string
to some array of ed25519 public keys, where the length of the array is no longer than maxRecipients
.
NOTE: maxRecipients
can't be more than 255. see private-box.
real.decrypt(ciphertext, secretKey)
decrypt ciphertext with a secret key.
real.stringify(ctxt) / real.parse(str)
convenience functions for sending ciphertext over the wire.
var ciphertext = real// turn ciphertext into a string, so we can send it e.g. over post requestvar serialized = real // now turn it from a string back into a buffer, so we can decrypt itvar deserialized = realvar cleartext = real
license
BSD