Exploring_Cryptography.nb (87.7 KB)
1 Like
It’s great you are exploring cryptanalysis. But I think “Mathematica’s potential” first of all starts from using functional programing:
There are many built in functions in docs to use instead of writing loops. For example your first frequency stats could be just this:
CharacterCounts["The quick brown fox jumps over the lazy dog.",IgnoreCase -> True]
Giving:
<|" "->8,"o"->4,"e"->3,"r"->2,"u"->2,"h"->2,"t"->2,"."->1,"g"->1,"d"->1,
"y"->1,"z"->1,"a"->1,"l"->1,"v"->1,"s"->1,"p"->1,"m"->1,"j"->1,"x"->1,
"f"->1,"n"->1,"w"->1,"b"->1,"k"->1,"c"->1,"i"->1,"q"->1|>
Pretty, cool, right?
2 Likes
There is an example of breaking a Vigenere cipher in the resource function IrregularPeriodogram. With minor modifications (specifically, to change to lower case and remove white space and punctuation) it works on this example out of the box, so to speak.
1 Like
Thank you! That’s a great point, and is definitely something I’ll look into. Much appreciated.
