Speeding up the Vigenere Solver
2016-10-05 21:04 von Jens Guballa
Well, the existing PHP implementation of the Vigenère Solver contained quite some code optimisations, but as this tool is gaining more and more momentum it was time for some additional improvements. The implementation is heavily using arrays: The cipher text is stored in an array, the keys are stored in arrays, and the Vigenère Tableau itself is an array as well. Now from performance point of view working extensively with PHP-arrays slows down the application significantly. Therefore I decided to go the same way as with the Substitution Solver: implement the Vigenère Solver in C.
Now the work is done and (hopefully!) everything is working as before, just with one small difference: The C implementation is much faster than the PHP-equivalent. If a cipher took 30 seconds to analyse in PHP (e.g. when increasing the upper key length to 100 and above), the solver will now report the results after less than half a second.
The algorithms hasn't been changed or modified, so everyone can expect the same accuracy of the results as before.
I think it was well worth the effort.