Re:Hack-petya mission accomplished – Petya ransomware decryptor
by danbruc on Monday April 11, 2016 @06:01PM
(#11475508)
From a quick look at the code it looks like something derived from the key is compared with some value on the encrypted disc, i.e. a key verification check. Like you store passwords, you hash the password and compare it with the stored hash to check whether it is valid. You can then, at least theoretically, use the hamming distance as a fitness function and this seems to be what the code does.
What really confuses me is how this can possibly work for a cryptographic function where any change in any one of the input bit is supposed to, on average, flip half of the output bits. But then again I am not curious enough to analyze the code in detail.
[ Parent
| on HN ]
Re:Hack-petya mission accomplished – Petya ransomware decryptor
by SolarNet on Monday April 11, 2016 @06:59PM
(#11475824)
It looks like the implementors failed to follow the recommended usage and design (and indeed common sense) of the algorithm:
* They used 16 bit math instead of 32 bit math (with, I'm assuming, a 32 bit output size rather than the recommended 64 bit output). Which has the effect of looking like 10 rounds, but it's a rather more serious security failure.
* They generated keys in the alphanumeric range (instead of the full byte range) significantly reducing entropy.
All which seems to have weakened it substantially (understatement).
Re:Hack-petya mission accomplished – Petya ransomware decryptor
by danbruc on Monday April 11, 2016 @07:11PM
(#11475873)
I read that on the GitHub page but I am still having a hard time imagining that those changes weaken the function enough to become attackable by a genetic algorithm. According to my intuition even relatively weak cryptographic functions should be pretty hard to tackle by genetic algorithms due to the complex structure of the search space with many extrema. Maybe I will have a closer look tomorrow, I am starting to get really curious.
Re:Hack-petya mission accomplished – Petya ransomware decryptor
by SolarNet on Monday April 11, 2016 @09:10PM
(#11476493)
I think the limited key space is a large part of the answer, 46 lopsided choices is easier to learn about than 256 equally distributed choices. The smaller word width probably makes the memory requirements reasonable.