I have a list of DES encrypted strings/data, they come in two lengths, 32 chars hex (16 bytes) or - I believe - 64 chars. I know the key, which is 8 ascii chars (I might add that I am the rightful owner of the key and all data). Is is possible to decrypt the strings, given this information, or is is impossible without additional info about the implementation, IV's, padding whatnot?


1 Answer 1


That should be possible yes. It's probably ECB or CBC mode encryption. If it is CBC mode encryption then the first 8 bytes (16 hex characters) may be the IV. Otherwise it is likely to be a vector consisting of 8 zero bytes (or eight 00 hex characters of course).

I presume here that you can distinguish the result from random of course. If that's not the case you'll have to guess the encryption mode & IV used to encrypt.

If you can only decrypt the later part of the ciphertext then you are using an incorrect IV.

In the worst case you also have to try CFB or OFB or even CTR, but that's relatively unlikely.

Note that you first have to decode the hexadecimals to bytes. The key is probably already the same as the ASCII characters when viewed as bytes.

  • $\begingroup$ I've tried ECB and CBC with different IVs as you suggest. No luck so far, but I'll continue to try. Could it be that some joker configured the system with a static but random IV (or 8,7,6,5,4,3,2,1 or other) unknown to me? $\endgroup$
    – goorj
    May 4, 2015 at 10:49
  • $\begingroup$ If the IV is incorrect in CBC mode then only the first 16 bytes of plaintext will be corrupted. So look at the end of the decrypted plaintext. $\endgroup$
    – Maarten Bodewes
    May 5, 2015 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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