Encypting a URL
I am trying to implement some security features to a web project. For
various reasons, I need to encrypt a URL, then decrypt it and redirect to
the correct page.
I have implemented a few different ideas based on the .NET cryptography
classes and based on code from the web. Encryption in all cases works fine,
but decryption is a mess.
What I'm trying to do:
Take a url: eg http://www.foo.com?paramter=x
and encrypt it...
pass it to another page as a parameter: Eg:
where Link= refers to the encrypted url from above...
the processpage will then decrypt the url and redirect (if certain security
conditions are met).
All the solutions I've seen convert the encrypted byte array to a Base 64
string, then decrypt it using fromBase64...
My problem is I think the Base64 encoded string is being munged when it is
passed as a url parameter. When I try to decrypt the string (in another
page)...I get an invalid length error...
1. Is there an easier (secure) way to encrypt a url link?
2. Can you use a base64 encoded string in a url?
3. Are you still reading this <grin>?
Any help would be appreciated.