Hi.. I need help.
1) I have been getting this error. I downloaded it here.>>>
https://github.com/bitlogik/lattice-attackhowever, i have been getting errors. i wanted to check on weak edcsa but i couldn't get this program to run properly. even when i use the sample that comes with it and the gen_data.py ...it still dont work. is there something i need to change?
python3 lattice_attack.py
----- Lattice ECDSA Attack -----
Loading data from file data.json
Running with 6 bits of k (LSB)
Starting recovery attack (curve SECP256K1)
Constructing matrix
Solving matrix ...
LLL reduction
Traceback (most recent call last):
File "/home/krash/lattack/lattice_attack.py", line 259, in <module>
lattice_attack_cli(arg.f, arg.l)
File "/home/krash/lattack/lattice_attack.py", line 239, in lattice_attack_cli
result = recover_private_key(
File "/home/krash/lattack/lattice_attack.py", line 195, in recover_private_key
res = test_result(lattice, pub_key, curve)
File "/home/krash/lattack/lattice_attack.py", line 93, in test_result
if target_pubkey == ecdsa_lib.privkey_to_pubkey(cand1, curve):
File "/home/krash/lattack/ecdsa_lib.py", line 129, in privkey_to_pubkey
ec.derive_private_key(pv_key_int, ec_backend, backends.default_backend())
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/asymmetric/ec.py", line 332, in derive_private_key
raise TypeError("private_value must be an integer type.")
TypeError: private_value must be an integer type.
What is wrong here??
2)If i wanna input my own datas in (RSZ,hashes) which file should i change it at?
Thank you for your advise and help in advance.
It seems like you're encountering an error related to the type of the private key value in the lattice_attack.py script. The error message "private_value must be an integer type" suggests that there might be an issue with the format of the private key value being used.
To troubleshoot this issue, you should check the data file data.json that you're loading. Make sure that the private key values are stored as integers. If they are stored as strings or in a different format, you may need to convert them to integers before passing them to the relevant functions.
Regarding your second question, if you want to input your own data for (RSZ, hashes), you'll need to modify the data.json file directly. This file likely contains a JSON object with keys corresponding to different parameters used in the attack, such as the number of bits of the secret key k, the public key pubkey, and possibly other parameters like RSZ and hashes.
Simply locate the relevant keys in the JSON object and replace the existing values with your own data. Ensure that the format of your data matches what the script expects. After making the changes, save the file and rerun the script. Make sure to follow any specific instructions or conventions regarding the format of the data within the script's documentation or comments.