Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

I wrote my own cipher to encrypt messages. I would like to test a sample ciphered message to see how strong it is. Are there any tools for such task either in Windows or Linux ?

share|improve this question

closed as unclear what you're asking by D.W., DrLecter, e-sushi, AFS, archie Jan 12 at 5:00

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers 2

There's no way to verify the strength of a cipher in any automated way, especially given only the ciphertext. Attacking the construction of a cipher is an inherantly intellectual process, which does not fit well to the qualities of computer analysis.

For example, I could write a cipher such that $f(m) = rand(0,n)$ where $n$ is the largest integer representable in $sizeof(m)*8$ bits, and any automated analysis would say "this is an awesome cipher", but a human would immediately realise that it's totally useless.

If you're writing your own ciphers for real usage, I have only one piece of advice: don't.

Creating your own ciphers is fun, and it can give you a learning experience if you're actually doing it based on constructions you understand, but the resulting cipher should never ever go anywhere near a production system. Experts put their ciphers through years (decades, even) of peer review before they're adopted by anyone. If your goal is to learn, do so by breaking ciphers.

share|improve this answer

To calculate the time to brute force, you actually just have to look at the (effective) key space. If there are $k$ different possible keys, and all of them encrypt differently¹, it takes in average about $k/2$ tries to brute-force your cipher. How long this takes then depends on the speed of your cipher (or an optimized version thereof), and the hardware resources of an attacker.

¹This seems to be trivially the case, but it isn't: While DES uses formally a 64-bit key, 8 of these bits are not used, thus the effective key size is 56 bits, which means that in average $2^{56}/2 = 2^{55}$ tries are enough for brute-force.

Of course, with home-brewn ciphers usually the best attack is not a brute-force attack, but some clever cryptanalysis, which then only needs way less time. These ciphers are then called "broken".

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.