Abbas
Abbas

Reputation: 5044

how to hash the password and get it back

hey guys, i want to hash the password so it is totally encrypted, i am able to hash the password, but now the issue is i am not able to again get back the real password, is there any way i can get the real password using any of the hash, or is there any other way to encrypt and also decrypt the text into its original content...

Please reply as soon as possible.. Thanks and regards abbas electricwala.

Upvotes: 1

Views: 19575

Answers (6)

Luciano Fiandesio
Luciano Fiandesio

Reputation: 10207

Theoretically once the data is converted using a one-way hash function, the hashed version of the data cannot be used to recreate the original data. You may want to try a brute force attack against the hash code, using a dictionary. It naturally helps if you know which hash function has been used.

Upvotes: 1

Sem Vanmeenen
Sem Vanmeenen

Reputation: 2151

The whole point of hashing a password is so that you do not have to save passwords in clear text. If someone can get the hashed passwords, he can't convert them back to passwords. Also, don't forget to salt your hashing otherwise your hashed passwords are vulnerable to rainbow tables.

Upvotes: 5

datenwolf
datenwolf

Reputation: 162164

The idea of hash functions is, to make it impossible to reconstruct the orignal data from the hash. Furthermore there are infinite different inputs to a hash function giving the same result.

If you want to check if a password entered in, say a login form matches the valid passwort, hash the newly input password and compare the hashes.

Upvotes: 2

Erik
Erik

Reputation: 91260

Hashing isn't encryption, you cannot reverse it. You use hashing to check whether someone has a specific password, without knowing the password yourself.

Upvotes: 4

rene
rene

Reputation: 42414

You typically can't and shouldn't. You also hash the received password and compare the two hashes

Upvotes: 1

Mārtiņš Briedis
Mārtiņš Briedis

Reputation: 17752

Hash is a one way encryption - that's the point - not to be able to get the original information from it. Hash is meant for verifying integrity. You can check if a entered string is the correct password by hashing and comparing the hashes with the one you had before.

Upvotes: 8

Related Questions