Naked Science Forum
Non Life Sciences => Geek Speak => Topic started 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 .
-
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
-
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]
-
I wonder how they did it at Bletchly before the days of spell checkers ?
-
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
-
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):
- The early Enigma machines had a weakness that they could never encrypt a letter as itself. If you had a large block of text encrypted with a single key, you could rule out any encryption keys that decrypted any letter as itself: http://en.wikipedia.org/wiki/Cryptanalysis_of_the_Enigma#The_Enigma_machines
- Sometimes a marine buoy would be destroyed intentionally, which would be reported by a standard, short message. This "known plaintext" attack often allowed the cryptanalysts to work out the encryption keys for the day.
Note: Modern encryption codes will happily encrypt a byte as itself, so that method won't work any more.
-
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.