Ask a Question related to ASP.NET Security, Design and Development.
-
Myrsky Varis via DotNetMonster.com #1
Saving hashes or encrypted passwords in MS Access
Hi,
Can anyone tell me which field type to use in Access to save hashes or
encrypted passwords from VB.NET/ASP.NET? I have tried text and ole object,
but nothing gets saved properly. Or is my code wrong?
I am using the following function:
Public Function ComputeHashValue(ByVal data() As Byte) As Byte()
Dim hashAlg As SHA1 = SHA1.Create
Dim hashvalue() As Byte = hashAlg.ComputeHash(data)
Return hashvalue
End Function
And then the following code to save to Access:
Dim hashValue() As Byte
hashValue = ComputeHashValue(Encoding.ASCII.GetBytes
(txtPassword.Text))
dbAdaptor.Fill(ds, "main")
Dim dt As DataTable = ds.Tables(0)
Dim dr As DataRow = dt.NewRow()
Try
'Add values
dr("fldFirstName") = "FirstName"
dr("fldSurname") = "Surname"
dr("fldpassword") = hashValue
Myrsky Varis via DotNetMonster.com Guest
-
Encrypted Passwords
Please can somebody tell me if there is a simple way or tutorial to encrypt passwords when they are stored in the database and how to log in using... -
Help access SQL Data using Hashes
I am retrieving the following data from MySQL. I need to access the data via some sort of Hash or Array. I need to take this data and create a web... -
Saving passwords in Win Xp Home
My XP fails to save my passwords even though I check the "save password" option on the dialog box. I always have to reenter every time I go to a... -
Saving Passwords
I just bought a laptop with Windows XP and I cannot save my user nome or password in Outlook Express or other apllications. The box cannot be... -
Saving user names and passwords?
How do you save the user name and passwords of frequently accessed workgroup shares in Win XP Home? Thanks! -
swat #2
Re: Saving hashes or encrypted passwords in MS Access
Hi Myrsky Varis,
Use the System.Convert.ToBase64String function on the hashValue to
convert it to a Base64 encoded string before saving it to the db.
In Access: Use a text field to save the hash.
HTH
swat Guest
-
Myrsky Varis via DotNetMonster.com #3
Re: Saving hashes or encrypted passwords in MS Access
Thanks!
Helped 100%
--
Message posted via [url]http://www.dotnetmonster.com[/url]
Myrsky Varis via DotNetMonster.com Guest
-
Dominick Baier [DevelopMentor] #4
Re: Saving hashes or encrypted passwords in MS Access
Hello swat,
You could be even using stronger security by using something called "salted
hashes" or even "iterated salted hashes" - this makes brute force attacks
of your password database much harder and time consuming.
i have written a sample on how to store passwords using the above mentioned
technique in potential unsecure storages (==access)
you can find it here:
[url]http://www.leastprivilege.com/PermaLink.aspx?guid=b0e51388-71d1-4a6f-98d0-bc8cfbec4c3a[/url]
---------------------------------------
Dominick Baier - DevelopMentor
[url]http://www.leastprivilege.com[/url]
> Hi Myrsky Varis,
>
> Use the System.Convert.ToBase64String function on the hashValue to
> convert it to a Base64 encoded string before saving it to the db.
>
> In Access: Use a text field to save the hash.
>
> HTH
>
Dominick Baier [DevelopMentor] Guest



Reply With Quote

