# Brute force a ciphered message?

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 ?

-

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".

-
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.