MD5 Encryption

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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
 
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
 
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
 
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
 
Back
Top