MD5 Encryption

G

Guest

I need to create an MD5 encrypted variable to be passed to another web
technology.
the receiving end will take care of itself. However, i can't figure out how
to generate a simple hash value in asp.net VB
here is what i want to do:
given this string "hello"
create a hash value (MD5) and use a response.write to display it on screen.
that is all.

I've seen a few articals but i am looking for a simple example. I really
appreciate the help,
Thanks
KES
 
J

John Timney \(MVP\)

Fairly sure this snippet still works- dont know where it came from!

private string getHash(string Value)
{
System.Security.Cryptography.MD5CryptoServiceProvider sec = new
System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] encodedData = System.Text.Encoding.ASCII.GetBytes(Value);
encodedData = sec.ComputeHash(encodedData);
string retVal = "";
for (int i=0; i < encodedData.Length; i++)
retVal += encodedData.ToString("x2").ToLower();
return retVal;
}

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog
 
G

Guest

Thank You, Having a bad day i guess.
The example is what i needed as is the one from John.
You're both fine Americans!

--
Share The Knowledge. I need all the help I can get and so do you!


Steve C. Orr [MCSD said:
I've posted a VB.NET example of the MD5 hashing syntax here:
http://SteveOrr.net/faq/encrypt.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



Yankee Imperialist Dog said:
I need to create an MD5 encrypted variable to be passed to another web
technology.
the receiving end will take care of itself. However, i can't figure out
how
to generate a simple hash value in asp.net VB
here is what i want to do:
given this string "hello"
create a hash value (MD5) and use a response.write to display it on
screen.
that is all.

I've seen a few articals but i am looking for a simple example. I really
appreciate the help,
Thanks
KES
 
G

Guest

Thank You, Having a bad day i guess.
The example is what i needed as is the one from Steve


--
Share The Knowledge. I need all the help I can get and so do you!


John Timney (MVP) said:
Fairly sure this snippet still works- dont know where it came from!

private string getHash(string Value)
{
System.Security.Cryptography.MD5CryptoServiceProvider sec = new
System.Security.Cryptography.MD5CryptoServiceProvider();
byte[] encodedData = System.Text.Encoding.ASCII.GetBytes(Value);
encodedData = sec.ComputeHash(encodedData);
string retVal = "";
for (int i=0; i < encodedData.Length; i++)
retVal += encodedData.ToString("x2").ToLower();
return retVal;
}

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog



Yankee Imperialist Dog said:
I need to create an MD5 encrypted variable to be passed to another web
technology.
the receiving end will take care of itself. However, i can't figure out
how
to generate a simple hash value in asp.net VB
here is what i want to do:
given this string "hello"
create a hash value (MD5) and use a response.write to display it on
screen.
that is all.

I've seen a few articals but i am looking for a simple example. I really
appreciate the help,
Thanks
KES
 
J

John Timney \(MVP\)

Except that I'm English - but thats OK! LOL!

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


Yankee Imperialist Dog said:
Thank You, Having a bad day i guess.
The example is what i needed as is the one from John.
You're both fine Americans!

--
Share The Knowledge. I need all the help I can get and so do you!


Steve C. Orr [MCSD said:
I've posted a VB.NET example of the MD5 hashing syntax here:
http://SteveOrr.net/faq/encrypt.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



"Yankee Imperialist Dog" <[email protected]>
wrote in message
I need to create an MD5 encrypted variable to be passed to another web
technology.
the receiving end will take care of itself. However, i can't figure out
how
to generate a simple hash value in asp.net VB
here is what i want to do:
given this string "hello"
create a hash value (MD5) and use a response.write to display it on
screen.
that is all.

I've seen a few articals but i am looking for a simple example. I
really
appreciate the help,
Thanks
KES
 
G

Guest

Hey the Bit's are cool!!! Any citizen of a country that can come up with Dr.
Who (Tom Baker), the Prisoner, Rock Follies, and, not to mention Viz Mag. is
equal to any ultra consertive Imperialist such as myself!
so i say again: Your a fine American!!!
:) (lets hope we can all take a joke, lifes too short!)
--
Share The Knowledge. I need all the help I can get and so do you!


John Timney (MVP) said:
Except that I'm English - but thats OK! LOL!

Regards

John Timney (MVP)
http://www.johntimney.com
http://www.johntimney.com/blog


Yankee Imperialist Dog said:
Thank You, Having a bad day i guess.
The example is what i needed as is the one from John.
You're both fine Americans!

--
Share The Knowledge. I need all the help I can get and so do you!


Steve C. Orr [MCSD said:
I've posted a VB.NET example of the MD5 hashing syntax here:
http://SteveOrr.net/faq/encrypt.aspx

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net



"Yankee Imperialist Dog" <[email protected]>
wrote in message
I need to create an MD5 encrypted variable to be passed to another web
technology.
the receiving end will take care of itself. However, i can't figure out
how
to generate a simple hash value in asp.net VB
here is what i want to do:
given this string "hello"
create a hash value (MD5) and use a response.write to display it on
screen.
that is all.

I've seen a few articals but i am looking for a simple example. I
really
appreciate the help,
Thanks
KES
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top