I\'m working on a quick captcha generator for a simple site I\'m putting together, and I\'m hoping to pass an encrypted key in the url of the page. I could probably do this
You're looking for HttpServerUtility.UrlTokenEncode
and HttpServerUtility.UrlTokenDecode
, in System.Web
.
They encode in base64, replacing the potentially dangerous '+' and '/' chars with '-' and '_' instead.
MSDN documentation
Have a look at System.BitConverter.ToString(myByteArray)
Handy for one way encoding for things like hashes but as pointed out by ssg it's not very efficient. I wouldn't recommend it for large amounts of data.