Skip to content

Latest commit

 

History

History
53 lines (34 loc) · 2.2 KB

README.md

File metadata and controls

53 lines (34 loc) · 2.2 KB

Genetische-Kryptoanalyse

Solve masc- and permchiffres with a genetic algorythm

.pl-files are configuration files for gnuplot. .sh-files contain code for managing the other code.

run ./doStatisticsMasc.sh and take some time.

I never tried this on a system different then mine, so perhaps some files are missing. If this code doesn't work for you, open an issue send me a mail.

The Haskell files in Detail

The Cryptography

Intersting stuff

  • NaturalLanguageModule.hs Tries to rate, how natural a string is.
  • Reordering.hs a wrapper for ReorderingCrossOvers.hs and ReorderingMutations.hs, with some small additions
    • ReorderingCrossOvers.hs different crossovers are described here
    • ReorderingMutations.hs different mutations are described here
  • GenMasc.hs runs evolution for decrypting a masc-chiffre and prints the results in a log file
  • GenPerm.hs runs evolution for decrypting a permutation-chiffre and prints the results in a log file (to be honest, I concentrated more on masc in the last weeks)

There where simple things that had to be defined and

  • MascModule.hs masc chiffres (encryption amd decryption) are defined here
  • SnModule.hs permutation chiffres (encryption amd decryption) are defined here
  • TypeModule.hs exports importent Types that are used in the other Haskell files.
  • BlindtextModule.hs Exports the encrypted text (and some more information about it).
  • NormalizeLanguageModule.hs Normalizes a string, so it holds no lowercase letters, spaces etc

performace testing

I didn't optimize very much of my code, but this was interesting.

  • lookuptest.hs analyses the performance of differnt methods of looking up values in a list

preparing data

These files are just for preparing data that is used elsewhere. They are not interesting, but had to be writen.

  • NaturalismHistogram.hs generates data for a histogram
  • ShowRandModule.hs lets you print data in the Rand-Monade (which is nontrivial in Haskell)
  • convertforBlindTextMonogramAnalysis.hs analyzing logfiles
  • convertforMultiplot.hs analyzing logfiles
  • convertforMonogramAnalysis.hs analyzing logfiles
  • convertforEliteplot.hs analyzing logfiles