3

I have a locked work file that I need access to. Unfortunately, the company that provided the file is no longer in existence and I can't track anyone down to help me out.

The file is encrypted and can be unlocked using a "source key". The source key is stored in a clear text .DAT file, and you can have multiple source keys in a single .DAT file. I've run some tests, and I can put thousands of lines (unlimited?) in this file and the software will check them all to see if one is a match for the encrypted file.

I'd like to create a .DAT file with all the possible dictionary attacks using these rules:

Source keys are text strings that follow IEC-1131 naming conventions. Specifically,
this convention states that an identifier must be a string of letters, digits, and
underline characters which begins with a letter or underline character. Underlines are
significant in identifiers (e.g., A_BCD is interpreted differently than AB_CD).
Multiple leading or multiple consecutive embedded underlines are not allowed, trailing
underlines are not allowed, and letter case is not considered significant. The source
key can be any text string that follows these rules and consists of up to 40 characters.

If anyone could help me with this, I'd be really grateful. Thanks

  • 1
    This is clearly a security related question, but the core of your actual question is how to programatically generate a dictionary. The best group to help you in this quest is stackoverflow.com. I suggest you to ask your question there and specify which computing environment you are using (OS, language). – dan Jul 27 '15 at 22:23
  • Do you know if the key is something like a password / passphrase (likely contains dictionary words) or just random bits encoded per IEC-1131? – puzzlepalace Jul 27 '15 at 23:55
  • @danielAzuelos The source key is arbitrarily chosen by the file creator, much like a password. However, unlike a password, it doesn't need to be remembered so it either could be something simple, like a word, or something like a random set of numbers and letters. The software is actually for PLC (a type of industrial controller) code. It's not something that is commonly dreamt with on Stackoverflow. Thanks – Nate Jul 28 '15 at 2:01
  • I suggest you to add these key information within your original question. I'll remove my comment: comments aren't there to hold questions but just to improve the original one. – dan Jul 28 '15 at 6:31
5

It would be pretty easy to write a script that will generate every possible key according to those rules and dump them in a .dat file. If you want, I can whip one up for you in python and post it here, but I don't think that would actually solve your problem.

Taking a rough squint at the math, you have an alphabet of 37 characters (26 letters + 10 numbers + _), with lengths of up to 40, so that's at least 37^40 different keys to try. At40 bytes per key, you're looking at roughly 10^66 bytes of data to store this file. Note that a terabyte is 10^12 bytes, so you would need 10^54 1 TB hard drives just to store the file.

The only way this would finish in your lifetime is if you know something about how they generated the keys which allows you to cut down the list of possible keys by 99.999999...% For example if you know that they only used 8-digit keys, or the keys were all English dictionary words, etc.

Without a lot more information, I don't think you're going to get much traction with this approach. :-(


Update:

If the key is a computer-generated random password then you're sunk with this approach, but your comments indicate that there's some chance that a human typed it in, which means there's some chance that you'll stumble across it in a cracked passwords dictionary.

skullsecurity.org seems to be a good source of leaked password lists (and comes with a recommendation from this answer).

crackstation.net seems to host a giant 15 GiB password list, though I can't personally vouch for it.

Depending on how much that file is worth to your company, you could download some of those lists, rename them to .dat, dedicate some computers to the cause, start one copy of the decryptor per CPU core (each one working on a different password list). Check on them after a month and with luck, one of them will have spit out a decrypted file. It's unlikely to work, but if the file is valuable enough to you, it could be worth trying.

  • Thanks. Like I mentioned above, the source keys are arbitrarily picked by the file creator, so a dictionary based attack might work, if I was lucky enough that the person making the key chose to just use a word!(which I've seen before) It's just as likely, though, that he didn't use any dictionary words. I've seen it both ways, so it's really up in the air. I guess I won't be able to crack this file after all. Thanks. I'll accept this as the answer unless someone is able to present an alternative solution. – Nate Jul 28 '15 at 2:07
  • @NateBergeron See update in body of answer. – Mike Ounsworth Jul 28 '15 at 2:41
-1

Look for tool Crunch it is word list generator, then try brutoforce.

  • 1
    To make a potential answer of your one line, add the URL of the 2 quoted softwares, and a minimal argument or a personnal practical feedback. – dan Jul 27 '15 at 22:30
  • A short guide on how the OP would use that tool to solve their specific problem would also be great. – Mike Ounsworth Jul 27 '15 at 22:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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