libdisco

libdisco is a modern plug-and-play secure protocol and a cryptographic library in Golang. It offers different ways of encrypting communications, as well as different cryptographic primitives for all of an application's needs.

Warning

libdisco is experimental. It has not been thoroughly reviewed and relies on an unstable specification. It should not be used in production.

libdisco is a library built by merging the Noise protocol framework and the Strobe protocol framework. This means that it supports a subset of Noise's handshakes while offering the cryptographic primitive Strobe has to offer. In other words, you can use libdisco to securely connect peers together, or to do basic cryptographic operations like hashing or encrypting.

  • The secure protocol parts are based on the Disco specification which extends the Noise protocol framework.
  • The symmetric cryptographic primitives are all based on the Strobe protocol framework which only relies on the SHA-3 permutation (called keccak-f).
  • The asymmetric cryptographic primitives (X25519 and ed25519) are based on the golang standard library.

Want to know more about the technical details? Watch our presentation at Black Hat Europe 2017.


To set it up, follow Golang's net/conn standard way of setting up a server with a libdisco config:

serverConfig := libdisco.Config{
  HandshakePattern: libdisco.Noise_NK,
  KeyPair:          serverKeyPair,
}
listener, err := libdisco.Listen("tcp", "127.0.0.1:6666", &serverConfig)
server, err := listener.Accept()

and the standard way of setting up a client with a libdisco config:

clientConfig := libdisco.Config{
  HandshakePattern: libdisco.Noise_NK,
  RemoteKey:        serverKey,
}
client, err := libdisco.Dial("tcp", "127.0.0.1:6666", &clientConfig)

it's that simple! Check out the get started section for more information.

Why use libdisco?

  • libdisco's source code is around 1000 lines of code without the cryptographic primitives. Around 2000 lines of code with the symmetric cryptographic primitive (Strobe), and 4000 lines of code with X25519 (for key exchanges). It makes it easy to audit and a pleasure to fit into tiny devices.
  • The protocol relies on the solid Noise protocol framework which is used by many others including WhatsApp, Wireguard, the Bitcoin Lightning Network, ...
  • The library relies only on two cryptographic primitives and nothing else: Curve25519 and the SHA-3 permutation.
  • libdisco is flexible. libdisco supports many different ways of securely connecting two peers together while avoiding complex certificates or public key infrastructures (unless you want to use them).
  • libdisco is versatile. While it allows you to securely link peers together, it is also an entire cryptographic library!

To make use of the protocol parts, you must first choose how you want to authenticate the connection. For that, it's easy! We have made a small quizz for you bellow, but if you already know what you want you can directly click on your favorite way of doing this in the menu under "protocol" (Noise_NK, Noise_XX, ...) and copy the usage examples.

Does your protocol involve only clients talking to a server (where the server doesn't reply back)?

To make use of the cryptographic library, check our overview here or directly access them through the menu on the left.


To learn more about it, you can read this blog post or watch our presentation at Black Hat Europe 2017 .

If you want help, head to the issues on github.

If you want to stay tuned on what we're doing, we don't have a mailing list but we have better: a subreddit over at r/discocrypto.