-2

Having the source string:

S3nh4#1

And the generated encrypted string:

csf7259aT07Rw

Using this script, it identified the algorithm used to encrypt as DES(Unix)

I wonder if it is possible (in computational and temporal terms) to find the key used to encrypt the source string.

  • I'm confused. Is it encrypted using DES, or are we talking unix password encryption using DES? – mikeazo Oct 28 '14 at 20:04
6

This is not DES encryption. This is password hashing with the old DES-based "crypt" scheme. The terminology is, of course, very confusing. DES is an encryption function, but here we are talking about a hashing construction that happens to internally use the DES block cipher; if you look at it closely, then you may notice that the "key" used for that internal DES block cipher is the password itself; and the internal block cipher is invoked 25 times.

  • 2
    Beat me to it. I wasn't sure at first as I haven't seen the DES format in a long time (was expecting a $). Note to OP: you can test it in python. First do "import crypt" then "crypt.crypt('kenanfx', 'csund')" and you will get "csund6XMTudO6" back. 'csund' is the salt in this case. – mikeazo Oct 28 '14 at 20:11
  • This is exactly what I want. A way to generate the hash, having only the input. – elias Oct 28 '14 at 20:24
  • 2
    @mikeazo: actually the salt is just 'cs'. The binary hash result (64 bits) gets encoded with a sort-of Base64, that yields 11 characters. The DES-based hash scheme uses a 12-bit salt, encoded as two characters. – Tom Leek Oct 29 '14 at 11:17
1

Linear cryptanalysis is a procedure for attacking block ciphers using plaintext-ciphertext pairs. However, it requires substantially more than one pair. Here's a paper that requires either 2^21 or 2^47 different pairs depending on the version of DES used. This may not be the most up to date, but the number of pairs needed is still considerable.

There are stronger attacks on DES, such as differential cryptanalysis, however they generally require access to an encryption oracle, i.e. that the attacker can choose plaintext pairs and get the resultant ciphertext.

EDIT: I misunderstood this to be about the DES cipher itself. See Tom Leak's post.

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.