One of the largest problems I saw in Ciphey was the fact that it ran infinitely.
People think it will always work, or that Ciphey isn't doing anything.
I'm going to build a timer that automatically stops decryptions after 60 seconds (this is changeable). This enables us to do 2 things:
In our lib.rs
file it calls a function crack()
which does everything.
We can have a thread and time how long this function takes to run. If it takes over 60 seconds, we should terminate it.
While Ares is running, users may think that it's doing nothing. We should create a count-down timer which counts down from 60 seconds to let the user know we're working.
$ Ares --text "neadndbbarhadnjad"
53 seconds remaining.
Users may see Ares as doing nothing, so we should also record how many decryptions it got to.
We can then return something like:
$ Ares --text "neadndbbarhadnjad"
Failed to find anything after 60 seconds and 1,103,819 decodings.
It is unlikely I can decrypt this text, to run infinitely use `--infinite`.
To help you on your journey, here are all of the encryptions I support:
<link>
It is unlikely that your text is encrypted with one of these.
We will need to create 2 threads: