lattice-attack icon indicating copy to clipboard operation
lattice-attack copied to clipboard

read from file r,s,z

Open eblanakusok opened this issue 3 years ago • 1 comments

If I have a format file: r, s, z How can I import it into this program? Or how to convert to json suitable for this program?

eblanakusok avatar Aug 25 '22 16:08 eblanakusok

First of all, please read the Use section of the ReadMe : https://github.com/bitlogik/lattice-attack#use

Then, you can look at the this file source, it can help into decoding into the target input. Because this file generates dummy data for an example, so it does the work to convert into the LatticeAttack expected format.

Also this real example code provided can give details and practical clues on how to generate data in the right format for this software.

Finally, the code itself contains some details (mostly redundant) about the expected input format. https://github.com/bitlogik/lattice-attack/blob/master/lattice_attack.py#L39

Additionally, I'd like to clarify some points regarding how to use it. There are 2 ways to provide the message or hash in the input data for LatticeAttack.

  1. Single common message In the case the message is the same for all the signature, this needs to be provided as a binary string message (not the hash, before hashing). The format is an integer list/tuple or bytes/bytesarray. The key is top-level "message". The hash used is SHA2-256 for the hash. Hence it works only for ECDSA using SHA2-256 hash.

  2. Per signature message In the case the message is unique per signature. The data to provide is an integer. The hash value is provided in the "hash" key in each signature object. The integer is the value of the binary bytes in big endian : from_bytes(h, "big").

In case you have a single message for all signatures. You need to provide the message directly in top data with key "message", the data before hashing (only if SHA2-256 hash). LatticeAttack will hash with SHA2-256. Alternatively, you can provide the hash value as an integer in every signature. The latter method is mandatory if the hash used is not SHA2-256 (or if messages are differents accross all signatures).

This software is 100% free. And we provide free support on how to use it, fixing bug, installation support, etc... Our free support doesn't cover data "translation", or input generation from your own data format. If you need support in cryptographic software development, including data format translation, we can't help you about that. You can reach us at [email protected], and we'll provide a quotation and a schedule for the work.

bitlogik avatar Aug 25 '22 16:08 bitlogik