- This topic has 4 replies, 3 voices, and was last updated 19 years ago by .
Viewing 5 posts - 1 through 5 (of 5 total)
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.
Home › Forums › Archives › Computer Support › Computer Support Discussion › Unhash
Is there a way to unhash something in PHP.
I used for example:
[PHP]
$test = md5(sha1(htmlspecialchars($word)));
[/PHP]
The database saved something like 3djh3rh234234hfdsd
How would I be able to convert the 3djh3rh234234hfdsd to make it display the true unhashed value?
I’ve tried Google but couldn’t find a solution.
Thank you,
Seb
well… not really doable. i’ve read places that you *can* decrypt a string that’s been run through sha1(), and i’ve read that you *can’t* decrypt an md5 unless you bruteforce it, so i dont know how you’d go about decrypting a double-encryption.
Ok thank you very much! 😀
For all intensive purposes, you cannot ‘decrypt’ a hash. That is because it is not an encrypted string. A hash is a value generated from a string, there is no way to ever go back from the hash to the string, because the hash has an infinite number of possible strings that, when hashed, can equal the hash. This is why the strings will all be nearly or the same length. An encrypted string has a reverse method that can decrypt it and return it to its original state; this is because the original string is ‘inside’ the encrypted one.
You can brute-force an md5 or sha1 hash, but doing so takes processing power and time, doing both on a string means that it would probably take years to generate a possible value on a home computer.
So basically, as Tom said – you’re SOL on the situation.
Thanks David for clarifying. 🙂