logoalt Hacker News

Breaking Enigma with Index of Coincidence on a Commodore 64

43 pointsby saganuslast Tuesday at 6:16 PM4 commentsview on HN

Comments

classichasclasstoday at 1:09 AM

Although he's trying to avoid using floating point, the dirty secret in many Microsoft-derived BASICs, including Commodore's, is that everything is floating point. In fact, even if you explicitly declare a variable as integer, it actually gets truncated and expanded: the native format for calculations is still 40-bit MBF. The only advantage integer variables have is smaller array storage. Every variable in his program is actually internally handled as a floating point value even though they're all integrals.

teo_zerotoday at 12:30 AM

I think the author is too quick to dismiss the impact of the plugboard.

> IC attacks only the rotor settings [...] Once you’ve found the right rotors and positions, you can solve the plugboard separately using frequency analysis.

So two steps: first solve for rotor settings with IC analysis, then solve the plugboard.

But IC analysis can't find the solution, just propose a lot of candidates among which a human can spot the correct one by looking for intelligible German text. And how can you spot intelligible German text if some letters are swapped by the plugboard?

show 1 reply
serious_angelyesterday at 10:38 PM

Freaking awesome... thank you very much!

Have you seen the film about Enigma, named "The Imitation Game" of 2014? I once or two asked about one of the main points of the film stated in there, yet no one still responded. Yes, I do sure rarely see films/movies nowadays (but wish so much...) for the time availability sake, but some may find the film interesting for that main point stated, I believe.

bediger4000last Tuesday at 7:22 PM

The fact that Index of Coincidence works against Enigma at all is the real puzzle.