Solved

VB.net Function to match ColdFusion hash function

Posted on 2004-09-07
4
327 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
4 Comments
 

Author Comment

by:wrenfro
Comment Utility
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
Comment Utility
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
Introduction In this tutorial, I'll explain how to create an animated progress meter in a wireframe prototype developed using Axure RP 7.0 - a leading prototyping tool for designing web sites and software. (For more information about Axure and gett…
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. …
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now