Saving hashes or encrypted passwords in MS Access

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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...
    2. 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...
    3. 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...
    4. 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...
    5. Saving user names and passwords?
      How do you save the user name and passwords of frequently accessed workgroup shares in Win XP Home? Thanks!
  3. #2

    Default 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

  4. #3

    Default 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

  5. #4

    Default 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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139