Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

If I wanted to brute-force decrypt data, I would try decrypting it with a key and see if the decryption returned nonsense. If the decryption returned meaningful data (ex. something that a natural language processor deemed English, if I was trying to decrypt an English language email), I would assume I had the key. If it did not return meaningful data, I would try again with the next possible key until I had tried all possible keys. But this method would not work if I did not know if I was trying to decrypt a picture, text in Spanish, text in Chinese, an audio file etc.

How do you brute force decrypt if you don't know what you are trying to find?

share|improve this question
    
You guess based on what is likely. You test the output to see if it seems to match this guess –  atk Aug 19 '13 at 12:10

2 Answers 2

up vote 4 down vote accepted

It is an extremely rare situation for a brute-force attacker to work on data where they have no idea at all what is encrypted. When brute-forcing encrypted files in an unencrypted folder labeled "financial documentation", it's a fairly safe guess that if you get valid document, spreadsheet, or PDF files, you've decrypted something.

Even without information leakage from a badly-managed file system, most common file types contain a great deal of standard metadata. PDF files, .doc files, .JPG files, and others contain fairly standard headers. Text files contain information about their encoding. A brute-force adversary would spend time looking for this metadata. (This is, in fact, a form of Known Plaintext attack.) It doesn't matter whether that Word document is in English, Chinese, Swahili, or Esperanto. It's still a Word document, with all the metadata associated with it.

Though it's not precisely what you're asking about, cryptananalysis of the Enigma during World War II involved a similar form of this attack.

share|improve this answer
    
I've never heard of that 'weather report messages'. If you're referring to the Enigma, the encryption was revealed (apart from Turing's efforts at Bletchley Park) because the same key was used for 2 different messages. –  ott-- Aug 19 '13 at 21:06
    
@ott--: You're right and wrong, now that I take the time to look it up further. (And assuming that the references at the Wiki page on Enigma cryptanalysis are accurate.) I've updated my answer accordingly. –  Jonathan Garber Aug 20 '13 at 13:28
    
Tsk. I feel hard done by because I answered this pretty much identically 28 seconds earlier than you and didn't get a single upvote! –  deed02392 Aug 28 '13 at 16:48

Depending on the implementation, there can be straightforward methods of confirming the key was correct.

For example, TrueCrypt utilises an encrypted hash of the valid master key/header. After trying a user decryption key, the hash of the header is checked. If the hash matches, TrueCrypt proceeds to boot, if not then the user is prompted their password was incorrect.

When considering whether this is foolish or not - since you're essentially giving an attacker a way of easily checking if they guessed the right key, don't forget that if TrueCrypt didn't do this, when users did enter an incorrect password the BIOS would then try to boot from essentially a corrupted partition table (and who knows what might happen then, data integrity wise).

In more generic cases, a good method would be to calculate the entropy of the output data. If you are expecting for example a document, then you could safely assume your correct decryption would have a very low entropy, and characters only in the [a-z0-9,.'] character set for example.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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