mirror of
https://github.com/Smaug123/ClassicalCiphers.jl
synced 2025-10-11 04:18:39 +00:00
Make crack_cipher outputs consistent for different ciphers
This commit is contained in:
@@ -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
|
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user