Welcome Guest [Log In] [Register]
Viewing Single Post From: Brute Forcing The Adfgvx Cipher
jdege
Member Avatar
Elite member
[ *  *  *  *  * ]
Revelation
May 14 2008, 02:27 PM
If you see room for optimisation, please let me know. It should run as fast as possible.

I don't think you're going to see much room for optimization in the code you have so far. It'll be your test routines that will be the pace where I'd expect most of your time to be spent.

And there, I'd expect two places where optimization might pay off.

1. How you access the statistics.
2. What sort of math you do on the statistics.

And in truth, I don't see much room for improvement in 1. You plan on matching 2-grams, or maybe 4-grams? Both are small enough to keep in a non-sparse array, there isn't anything that's faster than array lookup.

As for 2? Use integers, instead of floats. Add logarithms instead of multiplying, etc. Lot's of possibilities.

But my real advice? Use a profiling tool. No point in optimizing where your program isn't spending any time.

And remember - premature optimization is the root of all evil.


When cryptography is outlawed, bayl bhgynjf jvyy unir cevinpl.
Offline Profile Quote Post
Brute Forcing The Adfgvx Cipher · General