3 ms·
Not sure, "define" only appears 10 times but "function" appears 19 times. It's probably because 'e' is more popular in the code and "define" has two of them. Lo
by alexkus 13y ago
Not sure, "define" only appears 10 times but "function" appears 19 times. It's probably because 'e' is more popular in the code and "define" has two of them. Looking at the decrypted code there are much better strings to try; "function_exists" gives the right key first time too.
It could have been made a lot harder by using comments at the end of each line to pad the code with extra characters to equal out the frequency distribution and make this kind of frequency analysis impossible.
- JonnieCache 13y agoCould I make it even worse using ruby's unicode support? eg this kind of nonsense: π = Math::PI alias λ proc ● = λ {|r| π*r**2} puts ●.call 5 # 78.53981633974483
- alexkus 13y agoOh yes, although too many "alias" commands will mean that it's possible to search for the known plaintext of 'alias'. But the more non-ascii bytes there are the more it will put off my analysis which dependeds on isprint().