Skip to content
This repository has been archived by the owner on May 29, 2021. It is now read-only.

scuttlebutt-rust/scuttlebutt_crypto_boxstream

Repository files navigation

Scuttlebutt BoxStream

An implementation of the box stream protocol used by Scuttlebutt for secure communication between peers.

Usage

To create a pair of boxer/unboxer:

var client = new Client(network_key, server_publicKey, client_keypair);

var a = client.ClientEphemeralPubKey;
var b = client.ServerEphemeralPubKey;

var (client_boxer, client_unboxer) = BoxStreamBuilder.Build(
  client.ClientDerivedSecret,
  server_publicKey,
  client_keypair.PublicKey,
  network_key,
  a, b
);

After the creation of the Boxer and Unboxer they can be used for sending:

var plain = System.Text.Encoding.Unicode.GetBytes("hello world");

var msg = client_boxer.Box(plain);

And receiving:

var netstream = NetworkStream(inbound_conn, true);

var reply = await receiver.Unbox(netstream);
Console.WriteLine(reply);

License

Unless explicitly stated, all the files in this repository are under the AGPL license.

About

.NET implementation of Scuttlebutt's box stream

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages