I need to pass a userid as a guid number through a url quesrystring
my starting GUID is in string format = "23c6e6a5-e9fc-4fd0-aa15-e5db9b900388"
1) I encrypt it using tripledes
the resulting string value = "nJYKpGwOeoOWepKPSDyNnO+xk+ZcfYZnyxvAnKTNCMV/ZJ7CfDKcmA=="
if I immeadiately decrypt it get the expected original value (so my tripledes provider is working)
2) I then urlencode the value for placing into the url which results in:
urlencoded = "nJYKpGwOeoOWepKPSDyNnO%2bxk%2bZcfYZnyxvAnKTNCMV%2fZJ7CfDKcmA%3d%3d"
3) when a read it back from the url using Request.QueryString (a function which automatically decodes the value)
I get the value: "nJYKpGwOeoOWepKPSDyNnO xk ZcfYZnyxvAnKTNCMV/ZJ7CfDKcmA=="
It appears the "+" characters where replaced with " "
This incorrect value caused the tripledes decryption to fail.
I am using VS 2010 Framework 4.0, IIS7, IE8 and the System.Security.Cryptography.TripleDESCryptoServiceProvider
Is this a bug or am I doing something wrong. It appears the the problem is with the urlencode or the embeded urldecode which is part of request.querystring
Many thanks for any assistance in how to resolve this.
View Complete Post