Cryptopals 20 - Break fixed-nonce CTR statistically


Challenge 20 in Cryptopals.

As I anticipated, I probably misunderstood the previous challenge, or this one. Fact is that I just reused the terminal user interface to break the first part statistically and then move on by eye inspection and guessing. It was fun!

In hindsight, one thing that can be done to improve the thing is to try and guess more characters, progressively removing shorter strings. I mean, if we had 50 strings of length 50 characters and 1 of length 30, does it make really sense to guess 20 characters by hand?

Anyway, I sticked to the previous implementation as a nice diversion, like a puzzle where the initial part was actually done statistically.

It was more than mildly interesting that the first column was wrong again, even on the new encrypted stuff, but this time was really wrong. Probably I should have used different statistics for the start-of-sentence instead of a generic letter, but it was anyway very easy to understand from the context and - by the way, spoiler alert! - the first character of the first sentence was the same as challenge 19!

Stay safe and secure!

Comments? Octodon, , GitHub, Reddit, or drop me a line!