Verified Commit ea3e5132 authored by Aral Balkan's avatar Aral Balkan
Browse files

Update the readme

parent 0dc2f8ac
......@@ -2,7 +2,9 @@
Adds a symmetrically-encrypted authenticated messaging channel between nodes for the same database ([hypercore](https://github.com/mafintosh/hypercore), [hyperdb](https://github.com/mafintosh/hyperdb), or [hyperdrive](https://github.com/mafintosh/hyperdrive)). Currently used in Hypha to provide a secure ephemeral messaging channel between nodes owned by the same person for the purpose of authorising new nodes.
Based on [dat-ephemeral-ext-msg](https://github.com/beakerbrowser/dat-ephemeral-ext-msg) by [Paul Frazee](https://pfrazee.hashbase.io/).
Messages are encrypted using the `secretbox_easy` function from the _sodium-universal_ package. This currently uses the XSalsa20 stream cipher for encryption and a Poly1305 MAC for authentication.
This module is based on [dat-ephemeral-ext-msg](https://github.com/beakerbrowser/dat-ephemeral-ext-msg) by [Paul Frazee](https://pfrazee.hashbase.io/).
## Setup
......@@ -10,7 +12,7 @@ If you update the _schema.proto_, you must run `npm run protobuf` to generate th
## Spec
[A spec](spec.md) based on Dep-0000 is available. This has not been submitted anywhere yet.
[A spec](spec.md) based on [Dep-0000](https://github.com/beakerbrowser/dat-ephemeral-ext-msg/blob/master/spec.md) is available. The spec has not been submitted to the Dat working group yet.
## Usage
......@@ -18,7 +20,7 @@ If you update the _schema.proto_, you must run `npm run protobuf` to generate th
const { SecureEphemeralMessagingChannel } = require('@hypha/secure-ephemeral-messaging-channel')
// Create the channel, passing in the global signing secret key.
// (The channel will derive a separate secret key from it to use for symetric encryption.)
// (In Hypha, this is deterministically derived from the owner’s passphrase.)
const secureEphemeralMessagingChannel = new SecureEphemeralMessagingChannel(secretKey)
// Create a database (hypercore, hyperdb, or hyperdrive instance)
......
......@@ -31,7 +31,7 @@ message SecureEphemeralMessage {
}
```
There is no dictated structure for the plaintext message.
There is no dictated structure for the plaintext message but it is expected to be a JavaScript object.
The message is encrypted using the `secretbox_easy` function from the _sodium-universal_ package. This currently uses the XSalsa20 stream cipher for encryption and a Poly1305 MAC for authentication.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment