sha1 problem

From: Linda (lindan_at_analyticinnovations.com)
Date: 10/20/04


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?



Relevant Pages

  • Compare datasets with hash values or possibly another way?
    ... hash values of the datasets and compare those. ... ' Create a new instance of memory stream ... Dim formatter As New BinaryFormatter ...
    (microsoft.public.vstudio.general)
  • Compare datasets with hash values or possibly another method?
    ... I have two datasets with the same exact structure that I would like to compare. ... This is the code I performed on both datasets to get the hash values... ... ' Create a new instance of memory stream ... Dim formatter As New BinaryFormatter ...
    (microsoft.public.dotnet.framework.adonet)
  • RE: Hi All, need urgent help please.
    ... Are you comparing all the books against a 'master' copy or each book against ... Is there a set range of cells in each book that you want to check or is it ... The code below will compare specific sheets and list the results. ... Dim wksSheet1 As Worksheet ...
    (microsoft.public.excel.programming)
  • Re: Hash a range, output a Long Integer?
    ... Re the GetMD5Hash function in the root message. ... The problem with GetMD5Hash is I get the same hash if the cell value is ... I get a hash that that changes on the content of the cells. ... Dim hHash As Long ...
    (microsoft.public.excel.programming)
  • Re: checkboxes not updating and how do I move to next record?
    ... What I'm trying to do is compare the name fields of two tables. ... check off both boxes. ... I need the onEPLSDb checkbox checked off and the ... Dim RecordScrubbed As Boolean ...
    (microsoft.public.access.formscoding)