An implementation of KEMEDHOC, including machine-checked proofs, a quantum-safe variant of EDHOC key exchange protocol (RFC9528), powered by F*/Low*/KaRaMel toolchain.
The protocol design and implementation detail are available in my thesis.
Disclaimer: This is a research artifact, not a production-ready software. Use the library with your own risk.
Table of contents:
# install Ocaml
bash -c "sh <(curl -fsSL https://opam.ocaml.org/install.sh)"
opam init
opam switch create 4.12.0
eval $(opam env --switch=4.12.0)# install graphviz if you do not already have
# graphviz is required for visualizing function of ProVerif,
# e.g., illustration of attack traces.
opam depext proverif
opam install proverifAs FStar only works on specific Z3 versions, 4.8.5 and 4.13.3, so you need install
either particular version of Z3. Run the script provided at get_fstar_z3.sh
to get required Z3 packages.
./scripts/get_fstar_z3.sh /usr/local/binCheck if you have installed them correctly
z3-4.13.3 --version
> Z3 version 4.13.3
z3-4.8.5 --version
> Z3 version 4.8.5opam install fstar# install the latest version of KaRaMel compiler
opam install karamelOnce required packages are installed, please remember to run eval $(opam eval --switch=default)
to activate the environment containing installed packages.
Instead of manually installing dependencies, which is occasionally annoying, you can build and run the pre-defined Docker image.
docker_run.shTo verify EDHOC*, run the following command:
make -C src/edhoc verifyTo verify KEMEDHOC*, run the following command:
make -C src/kemedhoc verifyTo verify KEMEDHOC specification with ProVerif, run the following command
cd pv-models
./run-proverif.sh -f kemedhoc.pv -D <DEF>
# <DEF> should be [Anonymity, Model, ReflectionSimul]
# - Anonymity: model for validating identity leakage
# - Model: standard model for validating security properties
# - ReflectionSimul: model for validating Reflection/Selfie attackThe experiment setup is based on uoscore-uedhoc.
First, open a terminal for Responder and run the following command:
cd pq-uoscore-uedhoc/samples/linux_edhoc/responder
make
./build/responderThen open another terminal for Initiator and run the following command:
cd pq-uoscore-uedhoc/samples/linux_edhoc/initiator
make
./build/initiator -q -m <authentication_method>
# -q for employing post-quantum algorithms
# <authentication_method> should be 0-4. Method 4 is for KEMEDHOCYou should see the two parties establish a shared session key.