sha1 problem
From: Linda (lindan_at_analyticinnovations.com)
Date: 10/20/04
- Next message: Joe Kaplan \(MVP - ADSI\): "Re: sha1 problem"
- Previous message: Paul Clement: "Re: Access file denied - Urgent!!!"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: sha1 problem"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: sha1 problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 20 Oct 2004 10:29:22 -0500
I'm I'm trying to compare 2 hash values using sha1 one written in vb.net
and the other in Python.
The value I get in my vb.net code does not match the python code, or any
other hash calulator I have used.
Here is the .net code:
-----------------------------------------------
Dim UE As New UnicodeEncoding
Dim SHAhash As New SHA1Managed
Dim SHA1HASHValue() As Byte
Dim MessageBytes As Byte() = UE.GetBytes(TB_Input.Text)
SHA1HASHValue = SHAhash.ComputeHash(MessageBytes)
Dim b As Byte
Dim strHex As String
For Each b In SHA1HASHValue
strHex += String.Format("{0:x2}", b)
Next
LB_Output.Text = strHex
----------------------------------------------------------------------------
--------
example: If I use a text value of "a"
Run value in .net is: 0a04b971b03da607ce6c455184037b660ca89f78
compared to a hash calulator: 86f7e437faa5a7fce15d1ddcb9eaeaea377667b8
----------------------------------------------------------------------------
-----------------------------------
any ideas what is wrong here?
- Next message: Joe Kaplan \(MVP - ADSI\): "Re: sha1 problem"
- Previous message: Paul Clement: "Re: Access file denied - Urgent!!!"
- Next in thread: Joe Kaplan \(MVP - ADSI\): "Re: sha1 problem"
- Reply: Joe Kaplan \(MVP - ADSI\): "Re: sha1 problem"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|