Message Boards Message Boards

Exploring Mathematica's potential in simple cryptanalysis

Posted 2 days ago
POSTED BY: Theo V
3 Replies

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.

POSTED BY: Daniel Lichtblau

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?

POSTED BY: Kapio Letto
Posted 2 days ago

Thank you! That's a great point, and is definitely something I'll look into. Much appreciated.

POSTED BY: Theo V
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract