Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.
/ seam Public archive

Simple Encrypted Authenticated Messaging

License

Notifications You must be signed in to change notification settings

notduncansmith/seam

Repository files navigation

GoDoc Build Status codecov

SEAM - Simple Encrypted Authenticated Messaging

⚠️ WARNING: THIS IS ALPHA SOFTWARE AND HAS NOT BEEN AUDITED. USE AT YOUR OWN RISK. ⚠️

The SEAM library implements a small encoding standard for exchanging messages signed and encrypted with TweetNaCl (and compatible) constructions: sign, box, and secretbox.

SEAM is designed to enable two messaging modes.

  1. In direct message (or "DM") mode, messages are encrypted with the box construction (x25519-xsalsa20-poly1305) using the recipient's public key and an ephemeral private key (the "transit" key).
{
  "mode": "direct",
  "body": "(base64-encoded encrypted bytes)",
  "destination": "(opaque string)",
  "nonce": "(base64-encoded nonce bytes)",
  "timestamp": 2234567890,
  "transitIdentity": "(base64-encoded X25519 public key)"
}
  1. In shared message (or "thread") mode, messages are encrypted with the secretbox construction (xsalsa20-poly1305) using a shared key.
{
  "mode": "shared",
  "body": "(base64-encoded encrypted bytes)",
  "destination": "(opaque string)",
  "nonce": "(base64-encoded nonce bytes)",
  "timestamp": 2234567890
}

All messages are encoded as JSON, digested with SHA512, signed with the sign construction (ed25519), and wrapped in an envelope with the signing user's public key.

{
  "author": "(base64-encoded ed25519 public key)",
  "message": "(message JSON)",
  "signature": "(base64-encoded ed25519 signature of SHA-512 hash of message JSON)"
}

See GoDoc for full usage.

License

Released under The MIT License (see LICENSE.txt).

Copyright 2020 Duncan Smith

About

Simple Encrypted Authenticated Messaging

Resources

License

Stars

Watchers

Forks

Packages

No packages published