1

...If it's possible at all.

By hash I mean md5, sha1, sha256.

And how difficult is it? I mean, if it's possible mathematically, are there any tools around?

  • Is there some underlying question here? Why do you want this? – Sjoerd Nov 29 '18 at 12:22
  • @Sjoerd it would make rainbowtables relevant again :) – schroeder Nov 29 '18 at 12:50
  • @Sjoerd This is merely of theoretical interest. – George Sovetov Nov 29 '18 at 15:55
  • @schroeder I don't know how rainbow tables work and how they differ from indexed tables. It's not just a problem of reversing the hash. I know the salt. That's the difference. If someone who knows how exactly these hash functions work can tell that known salt doesn't help, that's the answer. – George Sovetov Nov 29 '18 at 16:02
  • @GeorgeSovetov my answer explains all that. A known substring does not weaken the hash. – schroeder Nov 29 '18 at 16:54
11

You cannot extract a substring from a hash, and that's what you are asking to do.

Take the terminology out of your question and it becomes: How do I get

hash("apple baker charlie") from hash("apple baker charlie delta")?

You cannot. Hashes are one-way processes. You would have to crack the entire hash, know what the salt was, then rehash the original string (the password, in your example).

Knowing the salt does one thing (potentially) for you: you know that you have cracked the hash because you can identify the salt in the result. But this does not technically make the process faster.

  • However, a problem with appending the salt to the password like this is that depending on the length of the password, the length of the salt, their character set and the hash function it might be possible to use a rainbow table to reverse the string "password + salt" and then just split the salt off. – ecdsa Nov 29 '18 at 12:50
  • 1
    @ecdsa I thought that's part of what I covered in "crack the entire hash". Am I missing something? – schroeder Nov 29 '18 at 12:51
  • 2
    @ecdsa It may be possible, but the amount of depends is large, and the effort way too big to think it's reasonable possible. You will end up bruteforcing the entire hash space, twice. – ThoriumBR Nov 29 '18 at 12:52

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.