Please Help - Encryption Problems

From: Jamie Sutherland (jamie.sutherland_at_nhcscotland.no.spam.com)
Date: 04/23/04


Date: Fri, 23 Apr 2004 14:45:38 +0100

Hi,
I have a problem in that I have 2 applications writing to the same Database.
One App is web based and the other is windows/forms based.
Both have the same job in that they can reset a users password in the
database. Both are using SHA1 encryption however they both ghive different
results when the programs are run.
If I run the windows exe file and set the password to password the exe
encrypts as follows: 5BAA61E4C9B93F3F68225B6CF8331B7EE68FD8

If I run the web based version with the word password I get the following:
5BAA61E4C9B93F3F0682250B6CF8331B7EE68FD8

Notice the web version has extra in it.
Please help..... Below is the code I have been using for both versions:

Web Version:
Dim PwdAs String = "password"
Dim hashedPwd As String =
FormsAuthentication.HashPasswordForStoringInConfigFile(Pwd, "SHA1")
Return hashedPwd

Windows Exe Version:
Dim PwdAs String = Trim("password")
Dim Data As Byte()
Data = System.Text.Encoding.ASCII.GetBytes(Pwd)
Dim shaM As New SHA1Managed
Dim resultHash As Byte() = shaM.ComputeHash(Data)
Dim hashedpwd = ""
Dim b As Byte
For Each b In resultHash
hashedpwd += Hex(b)
Next
Return hashedpwd

Thanks
Jamie



Relevant Pages

  • Re: delete row blocked by non-existant relationship
    ... >Running Access 2003 on Windows 2000. ... You might need to use this small nuclear device (back up your database ... Dim db As DAO.Database ... Debug.Print "Deleting relation "; rel.Name, rel.Table, ...
    (microsoft.public.access.tablesdbdesign)
  • Re: Database Stuff
    ... you don't need MS Access to use MDB files. ... installed with Windows update and even IE. Windows 98 comes with ADO 1.5. ... VB6 have a wizard to build a form based on a database table or query. ... Dim rsForUseInCode As ADODB.Recordset ...
    (microsoft.public.vb.general.discussion)
  • Re: FATAL ERROR WHEN SENDING ACCESS REPORT TO PDF....
    ... ' Fill in the options for this switchboard page. ... Dim con As Object ... Compact the database to get completely rid of the Name AutoCorrect junk: ... > BTW, when Acrobat installs, it loads the Acrobat Assistant into your Windows ...
    (microsoft.public.access.reports)
  • Please Help - Encryption Problems
    ... I have a problem in that I have 2 applications writing to the same Database. ... If I run the windows exe file and set the password to password the exe ... Dim PwdAs String = "password" ... Return hashedPwd ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Is This Possible ... ? Yes - Upload images to an Access database
    ... It looks like your databases folder is outside the root of your web ... I created a database exactly as you said, the only change I made was to ... and underneath an 'upload' button and a 'view images' button. ... Dim con As New Data.OleDb.OleDbConnection ...
    (microsoft.public.dotnet.framework.aspnet)