Re: Please Help - Encryption Problems
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 04/23/04
- Previous message: Bigtoga: "Can I force 401 error when user not authenticated?"
- In reply to: Jamie Sutherland: "Please Help - Encryption Problems"
- Next in thread: Hernan de Lahitte: "Re: Please Help - Encryption Problems"
- Reply: Hernan de Lahitte: "Re: Please Help - Encryption Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 23 Apr 2004 10:14:12 -0500
It is probably an encoding problem. Forms auth uses UTF8 encoding and you
are using ASCII. I suggest you try switching to UTF8 first.
Joe K.
"Jamie Sutherland" <jamie.sutherland@nhcscotland.no.spam.com> wrote in
message news:eH30GnTKEHA.3380@TK2MSFTNGP09.phx.gbl...
> 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
>
>
- Previous message: Bigtoga: "Can I force 401 error when user not authenticated?"
- In reply to: Jamie Sutherland: "Please Help - Encryption Problems"
- Next in thread: Hernan de Lahitte: "Re: Please Help - Encryption Problems"
- Reply: Hernan de Lahitte: "Re: Please Help - Encryption Problems"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|