Solved

VB.net Function to match ColdFusion hash function

Posted on 2004-09-07
4
333 Views
Last Modified: 2013-12-24
I am looking for some VB.net code to match the ColdFusion Function hash().

I am working on a Web/Client application that is caching some security on the client and needs to work in a disconnected environment using vb.net.  the passwords have been saved after using the hash function.  

here is a sample if the vb code I have tried but the result does not match  the result from hash("test")
 
Dim md5Hasher As New MD5CryptoServiceProvider
Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding
hashedBytes = md5Hasher.ComputeHash(encoder.GetBytes("test"))
        Dim hashString As String
        hashString = Convert.ToBase64String(hashedBytes)

any ideas?
0
Comment
Question by:wrenfro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Author Comment

by:wrenfro
ID: 12001205
The ColdFusion page returns the hash as a hex representation

the following code will do the same in VB.NET

Dim PWordbyte As Byte

        For Each PWordbyte In hashedBytes
            hashString = hashString & String.Format("{0:X2}", PWordbyte)
        Next
0
 
LVL 35

Accepted Solution

by:
mrichmon earned 125 total points
ID: 12050006
The problem is that there is a key that is assigned to seed the hash and it will be different in CF and VB.

I don't know that with the default hash seed that you will be able to do this without setting the see your self in the respective applications
0

Featured Post

Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides a case study on how our local youth baseball league deployed a new website, including the platform selection, implementation and benefits to the league.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question