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?

1 Answers1

10

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.

schroeder
  • 123,438
  • 55
  • 284
  • 319
  • 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