Make crack_cipher outputs consistent for different ciphers

This commit is contained in:
Smaug123
2016-01-16 21:45:40 +00:00
parent aebd353646
commit d3b54be6ed
5 changed files with 11 additions and 9 deletions

View File

@@ -61,5 +61,5 @@ function crack_affine(ciphertext; mult=0, add=-1)
sort!(decrypts, by=(x -> string_fitness(x[2])))
decrypts[end]
reverse(decrypts[end])
end

View File

@@ -172,6 +172,6 @@ function crack_monoalphabetic(ciphertext; starting_key="",
println("Best was $(total_best_key) at $(total_best_fitness)")
println(total_best_decrypt)
end
(key, decrypt_monoalphabetic(ciphertext, key))
(decrypt_monoalphabetic(ciphertext, key), key)
end