'C# Decryption of value from SQL Database using Hash Algorithm

I'm using the code below provided by Microsoft for a Hash Algorithm

https://docs.microsoft.com/en-us/dotnet/api/system.security.cryptography.rfc2898derivebytes?view=netframework-4.8

What have been able to encrypt the password and save it to my SQL Database.

What I cannot do is retrieve the password from the SQL Database to compare it to an entered password by a user.

Any help greatly appreciated.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source