hadipourh / autoguess

An easy-to-use, general and open-source tool to search for guess-and-determine attacks and key bridges
https://hadipourh.github.io/autoguess
MIT License
27 stars 4 forks source link

autoguess-tool install problem #2

Closed GoldenHamed closed 1 year ago

GoldenHamed commented 1 year ago

Dear author. I don't know if it's my problem. I followed the instructions you gave to install the program. But two commands from your tool are not executed. I have attached the results of running these commands for you. error.txt

Best wishes to you!

hadipourh commented 1 year ago

Hi Hamed,

Thanks for your interest in our tool. It seems you could not manage to install some solvers completely, e.g., Or-Tools, and Cadical. That is why you are getting these errors in the run time.
Try to reinstall the tool. But this time, please ensure you can successfully perform the instructions in the installation phase. Hope that my comment helps! But, if you get any error during the installation again, please let me know the error in detail, e.g., which tool can not be installed based on our instructions and which OS you are using.

GoldenHamed commented 1 year ago

Prerequisite tools installed correctly. I have attached the results of reinstalling the tools for you... install.txt

hadipourh commented 1 year ago

Thanks for your useful feedback! I tried reinstalling the tool and reproducing the results to determine the problem. I noticed that these kinds of errors only appear when running the tool with sudo or root privileges. It is generally recommended to avoid using sudo when running Python tools unless necessary. For Autoguess, sudo is not required. If you have placed the source file in a directory that requires root privilege, you can simply move it to a different location where root privilege is not needed, and then run the tool without sudo. I hope my comment helps, and you can successfully run the tool. Feel free to report back here if my suggestion does not resolve the issue. Thanks once again for your useful feedback :-)

GoldenHamed commented 1 year ago

Unfortunately, I could not install your program with method 3. I installed dockerfile with sudo command. Only one command is not executed...

sudo docker run --rm -it autoguess

root@fa283a6091f5:/home/tools/autoguess# python3 autoguess.py --inputfile ciphers/Example1/relationfile.txt --solver sat --maxguess 2 --maxsteps 5 Traceback (most recent call last): File "/home/tools/autoguess/autoguess.py", line 211, in main() File "/home/tools/autoguess/autoguess.py", line 208, in main startsearch(params) File "/home/tools/autoguess/autoguess.py", line 26, in startsearch search.search_using_sat(tool_parameters) File "/home/tools/autoguess/core/search.py", line 78, in search_using_sat gdsat = ReduceGDtoSAT(inputfile_name=parameters['inputfile'], File "/home/tools/autoguess/core/gdsat.py", line 48, in init self.supported_sat_solvers = list(solvers.SolverNames.cadical) + list(solvers.SolverNames.glucose4) + list(solvers.SolverNames.glucose3) + list(solvers.SolverNames.lingeling) + list(solvers.SolverNames.maplesat) + list( AttributeError: type object 'SolverNames' has no attribute 'cadical'

hadipourh commented 1 year ago

Thank you for providing your feedback!

Sorry to hear that you can not use SAT solver because it is the most efficient option in many cases.

The error you encountered is related to the settings and configuration of your system or my suggested configuration for creating the docker file. It is not a bug in the tool.

To address this issue, avoid the use of sudo when installing Python packages or Python tools. Note that I mean sudo for installing/using Python tools, not docker. So, if you have used sudo to install docker, it is okay.

I recently tested 'method 3' for installation and slightly updated it. Therefore, my initial suggestion would be to consider installing the tool using 'method 3' if you can access a Debian-based Linux distribution.

However, if you prefer to continue using method 1 or 2, you can try resolving the issue by replacing line number 48 in the file core/gdsat.py with the following line of code:

self.supported_sat_solvers = ['cd', 'cdl', 'cadical', 'g4', 'g41', 'glucose4', 'glucose41', 'g3', 'g30', 'glucose3', 'glucose30', 'lgl', 'lingeling', 'mpl', 'maple', 'maplesat', 'mcb', 'chrono', 'chronobt', 'maplechrono', 'mcm', 'maplecm', 'mc', 'mcard', 'minicard', 'm22', 'msat22', 'minisat22', 'mgh', 'msat-gh', 'minisat-gh']

I hope that it helps. Given that this issue is not universal, I will ll close it.

GoldenHamed commented 1 year ago

The problem was solved. There is no such thing as Cadical in solver.py file. There are two types of Cadical, 103 and 153. So I changed the places where you used Cadical to Cadical103.

Thanks a lot ...