MD5 encryption examples

K

Kenneth

Hi,

I need an example on MD5 encryption.

In a ascii textfile I have a date in string format. I need
an example how to compute a hash value on the datestring
and another method to compare the two with each other.

TIA

/Kenneth
 
A

Alek Davis

Kenneth,

If you want to use MD5 (or SHA-1) hashing, the easiest way would be to call
the HashPasswordForStoringInConfigFile method, which returns a bas64-encoded
hash value. e.g.:

// C# code
using System.Web.Security;
....
string base64HashValue =
FormsAuthentication.HashPasswordForStoringInConfigFile
("1/2/2003 7:04 PM", "md5");

Then you can simply compare strings. If you want to keep the hashed value in
the byte array format (or want to do something more sophisticated), check
this example: http://www.obviex.com/samples/hash.aspx.

Alek
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top