This repository contains a set of minimal, easy-to-reproduce attack demos. They showcase how an attacker can pick any base b they like and then craft nonce values of the form
- Lindell17 (+)
- Lindell17 (*)
- Refresh Lindell17 (+)
- Patched HD Lindell17
This repository contains attack demos implemented in two languages:
-
C++ demos:
- Lindell17 (+)
- Lindell17 (*)
- Refresh Lindell17 (+)
-
Go demo:
- HD Lindell17 (based on OKX’s implementation)
The following two sections explain how to build and run them.
mkdir build && cd build
cmake ..
makeThe executable is usually:
./AttackLin17
Edit main.cpp and uncomment the attack you want to execute:
// To run the attack on Lindell(*), uncomment the following line:
// run_lin17_mul_with_corrupted_p2();
// To run the attack on Lindell(+), uncomment the following line:
// run_lin17_plus_with_corrupted_p2();
// To run the attack on Refresh Lindell(+), uncomment the following line:
run_refresh_lin17_plus_with_corrupted_p2();Rebuild and run:
make -j
./attack_lind17_demoEach demo exposes a file where you can change the base
-
Lindell(+):
lin17_plus/digit_by_digit_attack.cpp -
Lindell(*):
lin17_mul/digit_by_digit_attack.cpp -
Refresh Lindell(+):
lin17_mul/refresh_lin17_plus.cpp
Edit the file, adjust the parameter
This patched HD Lindell17 attack demo is implemented in Go and is based on the open-source OKX threshold-lib. The attack is reproduced by modifying the behavior of the corrupted party (P2) inside the signing protocol, allowing the Selected-K2 Attack to be triggered in practice.
To run the attack:
cd tss/ecdsa/sign
go test -run TestEcdsaSignWithMaliciousP2_2Note: This demo targets a specific historical commit of OKX’s threshold-lib and does not apply to the latest version of their open-source library on the master branch.
This repository is intended solely for academic research and demonstration of known vulnerabilities in existing papers and implementations.
Do not use any of this code in production systems !!!
[1] Attacks on Implementations of Lindell 17 and Its Variants.