Adesh Mishra
Adesh Mishra

Reputation: 69

How to Decrypt Password in c# using Salt and Hash.?

How to Decrypt Password in c# using Salt and Hash.? Salt and Hash already stored in SQL Server.

Hash & Salt

Here is attached screenshot of Database with hash salt and Hash.

Upvotes: 3

Views: 11695

Answers (2)

egrunin
egrunin

Reputation: 25083

I'm going to assume that this table is all there is, that there is no 'password' column or table. In which case:

There are no passwords here to decrypt, because this table does not contain passwords.

Here's what's going on: the user creates a password. It's hashed (using the salt) and stored as 123ABC. When they log on, they enter the password, which is then hashed (using the salt) and compared to the saved hash. If it comes out as 123ABC, fine.

The good part is, you never save the passwords, so they can't be stolen. Ever.

The bad part is that other strings will also hash to 123ABC, so someone with a table of all possible hashes (called a 'rainbow table') can get in using some other, known match. That's where the salt comes it, it makes it much harder to figure out possible matches.

Upvotes: 2

NattyMan0007
NattyMan0007

Reputation: 103

Depending on how you encrypt it, you probably can't decrypt it as Hash algorithms are generally one-way.

The only viable solution you have would be to bruteforce the hash and salt which by looking at it would take forever.

If you know how the data is encrypted in relation to the salt then this is relatively simple, and can be done either manually or automatically.

More about it here: https://msdn.microsoft.com/en-us/library/ee783861(v=cs.20).aspx

Upvotes: 1

Related Questions