1
$\begingroup$

I am playing around with Enigma Encryption, and especially solving it piece-wise, like in https://www.youtube.com/watch?v=RzWB5jL5RX0 shown. The idea is, that the text gets clearer, if you get more and more settings correct, but are still missing other settings.

For this, you need a fitness of text function, to decide the "englishness" of decrypted text. I found this one https://planetcalc.com/8038/#calculator8006 with single character frequencies, bigrams and trigams blended a quite nice approach.

Small numbers are "good", I guess. If I was to compare the corpus to itself, the formula in step 5 should (and will) deliver 0. Right?

However, the way I translated it into c# does not really work I think. All results come out as very small numbers, something like 1.0E-15 - even total gibberish before even attempting a decrypt.

Checking the formula in step 5, I wonder if this is missing abs() around the differences, or possibly squaring. Can you share your knowledge, if the formula in step 5 is missing operations?

$\endgroup$
1
  • $\begingroup$ Forgot to mention: Obviously, I just added abs() and tried it, and it looks quite reasonable now. Squaring did not look good. Am I missing something why without abs() could be correct? $\endgroup$
    – Ralf
    Apr 1 at 16:40

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.