Naked Science Forum

Non Life Sciences => Geek Speak => Topic started by: syhprum on 04/05/2012 18:47:07

Title: When to stop decoding
Post by: syhprum on 04/05/2012 18:47:07
When I have an ecoded message that requires say a 56 bit key to decode I can set up a brute force program to run thru all possible keys quite simple so far but how do I know when it is cracked I can't print out all possible results and find one that looks right .
Title: Re: When to stop decoding
Post by: CliffordK on 04/05/2012 21:53:58
Hmmm...
We'll hope this is for legal purposes.

256 = 7 x 1016 choices.

If you can do 3 billion (3GHZ) tests a second.
Then it would take about 8 months to go through all the choices.  Whew, I thought it would be longer, but I suppose that is why you chose not to do 64 bit or 128 bit encryption.  Still, you will need an efficient tight loop, and good parallel processing.

This is one of the reasons that most searches first begin with heuristic based searches.  Look for common names and dictionary words before slogging through brute force.  Also, if the code is made up of 7 bytes, you might restrict your search to printable characters.  Are there any characters that are not allowed by the encryption algorithm such as "return"?

This is one reason why it may be best to input codes in hex if octal or hex if possible.

Anyway, it would help to know a little about the document being decoded. 
If it is an MS Word document, perhaps look for particular characters in the header file.

If it is "text", then run the output through a spell checker.  Or, look for repeating characters such as a space that would repeat on regular intervals, usually less than every 10 characters or so.

If it is a hard drive, then look for specific system programs on the drive, or directory constructs.

Making a code within a code would make it much more difficult to crack.  And, of course, it helps to know the encryption algorithm.

Have Fun
Title: Re: When to stop decoding
Post by: RD on 04/05/2012 22:15:26
There are various "brute force" calculators online, which estimate how long it would take to crack passwords by trying every possible combination of characters permitted ...
e.g. ... https://www.grc.com/haystack.htm [this one runs in your browser, so doesn't send passwords over the internet ] 

... a 56 bit key ... brute force program to run thru all possible keys

seems that would take a typical PC the best part of a year (working 24/7) to try all the permutations.

Some keys include a check digit (http://en.wikipedia.org/wiki/Check_digit), if you know how that is derived the crack would not take as long.


http://howsecureismypassword.net/  [another program which runs in the browser via javascript]
Title: Re: When to stop decoding
Post by: syhprum on 05/05/2012 07:10:24
I wonder how they did it at Bletchly before the days of spell checkers ?
Title: Re: When to stop decoding
Post by: RD on 05/05/2012 07:19:30
I wonder how they did it at Bletchly before the days of spell checkers ?

they did have electromechanical computers ... http://en.wikipedia.org/wiki/Bombe
Title: Re: When to stop decoding
Post by: evan_au on 13/07/2012 13:16:44
Letters in encrypted text are random, while letters and words in a natural language have a characteristic distribution (somewhat different for different languages): http://en.wikipedia.org/wiki/Zipf%27s_law#Motivation

At Bletchley Park, apart from having some very bright mathematicians (like Alan Turing):

Note: Modern encryption codes will happily encrypt a byte as itself, so that method won't work any more.
 
Title: Re: When to stop decoding
Post by: nicephotog on 27/07/2012 04:25:47
Chinese calligraphy would be a better example of how to tackle cracking messages. Alike above, cryption does not mean a letter a function, only patterns and sequence. Chinese "words" are often enough unique as much a set of symbols. And something similar to first 600 units of count are a calligraphic word character each.

Database Error

Please try again. If you come back to this error screen, report the error to an administrator.
Back