Spoke
SPAKE2+EE implementation in OCaml
Install / Use
/learn @dinosaure/SpokeREADME
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.
Related Skills
node-connect
345.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
104.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
345.4kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
345.4kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
