Solved

How do I use MD5 and salt to generate a token

Posted on 2008-06-12
3
463 Views
Last Modified: 2013-11-07
I'm trying to create a URL that is made up of a set of parameters and a token that is generated using a MD5 hash function.  I'm a beginner at hashing and using salt to generate this token.  I've got the secret key(which i believe is the salt) and the string I need to hash.   I believe that is all I need in order to create my token.  Would you have any suggestions or links on how to generate the token I need?  Please let me know if you need more information.
Thanks.

0
Comment
Question by:GLlano
  • 2
3 Comments
 
LVL 13

Accepted Solution

by:
joechina earned 500 total points
ID: 21774007
Check this

http://msdn.microsoft.com/en-us/library/system.security.cryptography.hmacmd5.aspx

But you need to use memorystream instead of filestream in the example.

Good Luck
0
 

Author Comment

by:GLlano
ID: 21774389
The example on the link passes a key array into the constructor of a class.  
ex. Dim myhmacMD5 As New HMACMD5(key)

the example never shows how to create that class or what its doing with the key.  Do you
have any suggestions?

Thanks.
0
 
LVL 13

Expert Comment

by:joechina
ID: 21774666
If you key is a string, just do
byte [] keyByte =  System.Text.Encoding.ASCII.GetBytes.GetBytes(key);
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

743 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

11 Experts available now in Live!

Get 1:1 Help Now