package spoke

  1. Overview
  2. Docs
SPAKE+EE implementation in OCaml

Install

Dune Dependency

Authors

Maintainers

Sources

spoke-0.0.3.tbz
sha256=42adac21fca4d718902f55032b965b87ed906a20c9cf975e6d579f91888f2f8d
sha512=64387721c0f56343f46bfca4651e990adb38fd41d15dfc12bad1fa0ae4f63271e1a7c02bde222535843171f12a7775801e2d1b299d016fe51fe38801ce091e78

Description

A Password-authenticated key agreement protocol in OCaml

Published: 12 Jul 2024

README

Spoke, a password-authenticated key agreement protocol in OCaml

The goal of Spoke is to establish an agreement on two strong keys from a shared weak password. This implementation comes from a description of SPAKE2+EE available here.

Let's start with Bob and Alice. They share a weak password and they want to initiate a secure connection. Spoke is able to derive from this weak password 2 keys that can be used to establish a secure connection using symmetric encryption (like AEAD).

Spoke implements a handshake between Alice and Bob and returns the 2 keys for Alice and for Bob. It provides a Mirage_flow.S implementation which uses GCM, CCM or ChaCha20_Poly1305 as a symmetric encryption mechamism between the client to the server and the server to the client (they can be different).

You can simulate this handshake with the bin/simulate.exe program. It creates a socket and simulates a communication between Alice and Bob and finds an arrangement about 2 keys usable for symmetric encryption. Then, it sends a file to the server which repeats contents to the client. The client check the integrity of the received contents.

                         .---->----. (via GCM)
                 [ client ]       [ server ]
 (via ChaCha20_Poly1305) '----<----'

You can execute it with:

$ dune exec bin/simulate.exe -- filename 127.0.0.1:9000 hello-world

The goal of this tool is to ensure:

  • that the handshake is done correctly if Bob & Alice share the same password

  • the transmission throught a symmetric cipher from the shared keys works

A full explanation of the protocol and the handshake is available on my blog: Spoke, how to implement a little cryptographic protocol. Finally, you should take a look on bob which has a real usage of Spoke.

Dependencies (14)

  1. result >= "1.5"
  2. lwt >= "5.6.1"
  3. mirage-flow >= "4.0.0"
  4. mirage-crypto >= "0.11.0" & < "1.0.0"
  5. ke
  6. encore >= "0.8"
  7. bigstringaf >= "0.9.0"
  8. digestif >= "0.8.1"
  9. base64 >= "3.0.0"
  10. logs
  11. hxd
  12. fmt
  13. dune >= "2.9.0"
  14. ocaml >= "4.08.0"

Dev Dependencies (3)

  1. tcpip with-test
  2. rresult with-test
  3. mimic with-test

Used by

None

Conflicts

None

OCaml

Innovation. Community. Security.