Coder Social home page Coder Social logo

polyphony-chat / stimmgabel Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 159 KB

polyproto reference test implementation used for verifying other implementations of the protocol.

License: Mozilla Public License 2.0

Rust 100.00%
polyphony polyproto polyphony-chat

stimmgabel's Introduction

stimmgabel

Command-line utility implementation of polyproto, used for verifying other implementations of the protocol.

Motivation

Getting all aspects right when implementing a protocol can be difficult - especially when the protocol is new and does not have a lot of implementations to compare against. Stimmgabel (German for 'tuning fork') is a command-line utility to use as a verification tool for other implementations of polyproto.

Since this is a binary and not a library, it is fairly straightforward to use in various programming languages, by calling the binary with the desired arguments.

Installation

Download the latest release from the releases page. Alternatively, using the Rust tool chain, you can clone this repository and build the binary yourself.

After acquiring the binary, you can execute it from the command line:

stimmgabel --help

Interpreting the output

The program will exit with a status code of 0 if the verification was successful. Any other exit code indicates that there was an error during the verification process. The exit code is encoded as a bit flag, where the bits are set as follows:

Error Bit flag
GARBLED_INPUT (Unreadable input) 1 << 0
INVALID_INPUT (Readable, but wrong input) 1 << 1
CONSTRAINT_VIOLATION (Validation criterion not met) 1 << 2
BAD_SIGNATURE (Signature does not match data) 1 << 3
BAD_PUBLIC_KEY (Public key does not match signature or public key is weak/bad) 1 << 4

Verifying a message

polyproto does not dictate a specific format for messages. For this verification implementation, the following format is used, when passing a message to be verified:

{
    "message": "Any string",
    "signature": "Base64 encoded signature",
    "public_key": "Base64 encoded public key of the sender"
}

Minifying the JSON is allowed, and the order of the keys is not important.

Cryptography and Safety

polyproto does not specify a signature algorithm. For two implementations to be compatible, they must offer an overlapping set of signature algorithms. Stimmgabel only supports ED25519, using the ed25519-dalek crate, as ED25519 is the currently recommended signature algorithm for polyproto.

Important

This repository's cryptography, including keys and algorithms, is strictly for testing purposes. It uses the ed25519-dalek crate to implement polyproto with ED25519 as a signature algorithm. Learn about the safety guarantees of the ed25519-dalek crate for more information. This software has not received a security audit. No guarantees about its safety can be made.

stimmgabel's People

Contributors

bitfl0wer avatar

Stargazers

Erlend Sogge Heggen avatar

Watchers

Erlend Sogge Heggen avatar  avatar

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.