scarpacci
scarpacci

Reputation: 9194

SQL Server HashBytes

Can you unhash a value that you have stored in the DB?

So if I generate and store a value like this

SELECT HashBytes('MD5', 'HelloWorld')

Can I use a function to unhash it so that I can get the original value backout?

Thanks,

S

Upvotes: 1

Views: 1116

Answers (2)

user174624
user174624

Reputation:

Unfortunately not. If you are trying to check if a password or pass phrase is correct, you would only be able to encrypt what you've received, and then compare the two results. If they differ, then obviously the wrong information has been passed in.

Upvotes: 2

Remus Rusanu
Remus Rusanu

Reputation: 294267

No. Cryptographic hashes are by definition one way.

Upvotes: 2

Related Questions