Giter VIP home page Giter VIP logo

go-signal-protocol's Introduction

Examples (DRAFT)

Extended Triple Diffie-Hellman (X3DH)

X3DH Reference

Terminology

  • KeyServer - a service providing public key storage capabilities.

Participants

  • Alice - a person wants to send a message.
  • Bob - a person receiving the message.
Keys

All the keys are Curve 25519 keys.

  • Identity Key (Ik) - long term key. Key is generated once when a participant is created.
  • Signed Pre Key (Spk) - middle term key with it's id and signature. EdDSA scheme is used for generating a pre key signatures.
  • One Time Pre Key (Opk) - short term key with it's id. It's supposed to have bunch of keys saved on the server. Each key could be used once.
  • Ephemeral Key (Ek) - short term key. The key is generated during each protocol run. It's so named "session" key.
Functions
  • Curve() - a function generating Curve25519 key pair.
  • DH(k1, k2) - X25519 Elliptic Curve Diffie-Hellman function. Calculates a shared secret output from the passed keys.
  • KDF(km, salt) - a function representing HKDF algorithm. km is a key material used as a concatenation of calculated shared secrets using DH function. The function calculates two type of keys:
    • root key is used to derive a new chain key.
    • chain key is used to derive a new message key.
  • KDF_CK(chain) - an HKDF function for deriving message keys and a new chain key. A message key consists of four parameters:
    • cipher key - a key used for a plaintext encryption and ciphertext decryption.
    • mac key - a key used for HMAC calculation.
    • initialization vector (IV) - a parameter used for a chosen encryption algorithm.
    • index - a counter for an appropriate chain key. The counter is increased when chain key is updated. The counter is used for out-of-order messages processing.
  • Encrypt(messageKey, plaintext) - returns encryption of plaintext using the given parameters from a message key.
  • Decrypt(messageKey, ciphertext) - returns decryption of ciphertext using the given parameters from a message key.
  • Sign(ikB, spkB) - an EdDSA function returning signature of the specified signed pre key.
  • Verify(ikB, spkB, sign) - an EdDSA function used to verify the given signature of a signed pre key by the specified identity key.

Protocol run

Sequence diagram

Communication

Double ratchet

Sequence diagram

Multiple devices (TODO)

go-signal-protocol's People

Stargazers

Marco Giuseppe Toma avatar Dmitry Marshkov avatar

Watchers

Michael Guzelevich avatar James Cloos avatar Dmitry Marshkov avatar haxypants avatar

Forkers

zoranmihajlovic

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.