KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've taken a look at the StackOverflow question, "Password Encryption / Database Layer AES or App Layer AES," and I'd like to effectively and efficiently hash my passwords on registration (web app) and then be able to check they are correct on login. I'm using VB, but comfortable using C#. I would love to use Jeff Atwood's Encryption class described in ".NET Encryption Simplified" as it's really easy to understand. It has a hashing class—but I have no idea how to "login" and compare hashes after they have been hashed. This is Jeff's demonstration of his hash methods using his Encryption class: Sub DemoHash() Dim d As New Encryption.Data( _ "{ts '2004-10-09 08:10:04'}The world is beautiful and needs caring by its children") Dim hash As New Encryption.Hash(Encryption.Hash.Provider.SHA1) Dim hash2 As New Encryption.Hash(Encryption.Hash.Provider.SHA256) Dim hash3 As New Encryption.Hash(Encryption.Hash.Provider.SHA384) Dim hash4 As New Encryption.Hash(Encryption.Hash.Provider.SHA512) Dim hash5 As New Encryption.Hash(Encryption.Hash.Provider.MD5) Dim hash6 As New Encryption.Hash(Encryption.Hash.Provider.CRC32) hash.Calculate(d) hash2.Calculate(d) hash3.Calculate(d) hash4.Calculate(d) hash5.Calculate(d) Console.WriteLine("SHA1: " & hash.Value.Hex) Console.WriteLine("SHA256: " & hash2.Value.Hex) Console.WriteLine("SHA384: " & hash3.Value.Hex) Console.WriteLine("SHA512: " & hash4.Value.Hex) Console.WriteLine("MD5: " & hash5.Value.Hex) Console.WriteLine("CRC32: " & hash6.Calculate(d).Hex) Console.WriteLine() Dim salt As New Encryption.Data("salty!") Console.WriteL
Tags (comma-separated)
Save Edits
Cancel