By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,876 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,876 IT Pros & Developers. It's quick & easy.

Base64-Encoded URL in ASP

P: n/a
I am trying to integrate my ASP page with an external application that
sends me a QueryString that is URLEncoded and each Name and Value in
the QueryString is Base64 Encoded as well.

---------------------------------------------------------------
Sample QueryString:

MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ%3D%3DMjM3MzpiMTcxO DYwOjc%3D%26NzQzMTpwcm9kQWdlbmN5SUQ6MTI%3D%3DMjcxN jowMDUxMjIwODo4%26MTA0MjE6cHJvZEFnZW5jeU5hbWU6MTQ% 3D%3DMzA1NTA6REFVR0hFUlRZICYgQ08gSU5TIEJST0tFUlMgS U5DOjMw
---------------------------------------------------------------

I know what the named items in the QueryString are and accurately
Base64 encode them so that I see the text in the QueryString. But when
I try to get the matching value from the QueryString, I get an empty
string returned.

Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ%3D") = ''
Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ=") = ''
I tried looping through the name/value pairs in the QueryString but it
seems to think the entire QueryString is 1 named item with no value. I
put single quotes around each name and each value and got the
following:

'MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ==MjM3MzpiMTcxODYw Ojc=&NzQzMTpwcm9kQWdlbmN5SUQ6MTI==MjcxNjowMDUxMjIw ODo4&MTA0MjE6cHJvZEFnZW5jeU5hbWU6MTQ==MzA1NTA6REFV R0hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5DOjMw'
= ''
Any ideas how I can parse out each Base64-encoded name to to get the
matching Base64-encoded value?

Thanks,
Michael Levy
Jul 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"Michael" <Mi*****@MichaelLevy.net> wrote in message
news:44**************************@posting.google.c om...
I am trying to integrate my ASP page with an external application that
sends me a QueryString that is URLEncoded and each Name and Value in
the QueryString is Base64 Encoded as well.
I think the mistake that is being made is that only the name/values should
be URLEncoded, but in your case the entire string (including the "=") has
been encoded. There's no way to decode it. For example, if I had a
variable named foo, with a value of 1+1=2, that should be URLEncoded as:

foo=1%2B1%3D2

But instead, you have encoded the entire string:

foo%3D1%2B1%3D2

There is no way to know how to decode this so that the first %3D is the "="
between the name/value pair.

Peter Foti

---------------------------------------------------------------
Sample QueryString:

MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ%3D%3DMjM3MzpiMTcxO DYwOjc%3D%26NzQzMTpwcm9kQW
dlbmN5SUQ6MTI%3D%3DMjcxNjowMDUxMjIwODo4%26MTA0MjE6 cHJvZEFnZW5jeU5hbWU6MTQ%3D
%3DMzA1NTA6REFVR0hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5 DOjMw ---------------------------------------------------------------

I know what the named items in the QueryString are and accurately
Base64 encode them so that I see the text in the QueryString. But when
I try to get the matching value from the QueryString, I get an empty
string returned.

Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ%3D") = ''
Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ=") = ''
I tried looping through the name/value pairs in the QueryString but it
seems to think the entire QueryString is 1 named item with no value. I
put single quotes around each name and each value and got the
following:

'MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ==MjM3MzpiMTcxODYw Ojc=&NzQzMTpwcm9kQWdlbmN5S
UQ6MTI==MjcxNjowMDUxMjIwODo4&MTA0MjE6cHJvZEFnZW5je U5hbWU6MTQ==MzA1NTA6REFVR0
hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5DOjMw' = ''
Any ideas how I can parse out each Base64-encoded name to to get the
matching Base64-encoded value?

Thanks,
Michael Levy

Jul 19 '05 #2

P: n/a
Just URLUnencode it and then split for name value pairs and Base64 Unencode
the values - the code to achieve both is readily available on Google.

Chris.

"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message
news:10*************@corp.supernews.com...
"Michael" <Mi*****@MichaelLevy.net> wrote in message
news:44**************************@posting.google.c om...
I am trying to integrate my ASP page with an external application that
sends me a QueryString that is URLEncoded and each Name and Value in
the QueryString is Base64 Encoded as well.
I think the mistake that is being made is that only the name/values should
be URLEncoded, but in your case the entire string (including the "=") has
been encoded. There's no way to decode it. For example, if I had a
variable named foo, with a value of 1+1=2, that should be URLEncoded as:

foo=1%2B1%3D2

But instead, you have encoded the entire string:

foo%3D1%2B1%3D2

There is no way to know how to decode this so that the first %3D is the "="
between the name/value pair.

Peter Foti

---------------------------------------------------------------
Sample QueryString:

MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ%3D%3DMjM3MzpiMTcxO DYwOjc%3D%26NzQzMTpwcm9kQW
dlbmN5SUQ6MTI%3D%3DMjcxNjowMDUxMjIwODo4%26MTA0MjE6 cHJvZEFnZW5jeU5hbWU6MTQ%3D
%3DMzA1NTA6REFVR0hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5 DOjMw ---------------------------------------------------------------

I know what the named items in the QueryString are and accurately
Base64 encode them so that I see the text in the QueryString. But when
I try to get the matching value from the QueryString, I get an empty
string returned.

Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ%3D") = ''
Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ=") = ''
I tried looping through the name/value pairs in the QueryString but it
seems to think the entire QueryString is 1 named item with no value. I
put single quotes around each name and each value and got the
following:

'MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ==MjM3MzpiMTcxODYw Ojc=&NzQzMTpwcm9kQWdlbmN5S
UQ6MTI==MjcxNjowMDUxMjIwODo4&MTA0MjE6cHJvZEFnZW5je U5hbWU6MTQ==MzA1NTA6REFVR0
hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5DOjMw' = ''
Any ideas how I can parse out each Base64-encoded name to to get the
matching Base64-encoded value?

Thanks,
Michael Levy


Jul 19 '05 #3

P: n/a
"Chris Barber" <ch***@blue-canoe.co.uk.NOSPAM> wrote in message
news:OF****************@TK2MSFTNGP09.phx.gbl...
Just URLUnencode it and then split for name value pairs and Base64 Unencode the values - the code to achieve both is readily available on Google.
That will not work. If the original "=" seperating the name/value pairs had
not been encoded, then yes, you could have unencoded the name value pairs.
But with the entire string encoded, there's no way to know whether an equal
sign is meant to be a delimeter between name/value, or if it's part of the
value.

For example:
foo%3D1%2B1%3D2

If you were to unencode this, you would get:
foo=1+1=2

Now, is the variable name foo? Or is it foo=1+1?

Regards,
Peter

Chris.

"Peter Foti" <pe***@Idontwantnostinkingemailfromyou.com> wrote in message
news:10*************@corp.supernews.com...
"Michael" <Mi*****@MichaelLevy.net> wrote in message
news:44**************************@posting.google.c om...
I am trying to integrate my ASP page with an external application that
sends me a QueryString that is URLEncoded and each Name and Value in
the QueryString is Base64 Encoded as well.
I think the mistake that is being made is that only the name/values should
be URLEncoded, but in your case the entire string (including the "=") has
been encoded. There's no way to decode it. For example, if I had a
variable named foo, with a value of 1+1=2, that should be URLEncoded as:

foo=1%2B1%3D2

But instead, you have encoded the entire string:

foo%3D1%2B1%3D2

There is no way to know how to decode this so that the first %3D is the

"=" between the name/value pair.

Peter Foti

---------------------------------------------------------------
Sample QueryString:

MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ%3D%3DMjM3MzpiMTcxO DYwOjc%3D%26NzQzMTpwcm9kQW dlbmN5SUQ6MTI%3D%3DMjcxNjowMDUxMjIwODo4%26MTA0MjE6 cHJvZEFnZW5jeU5hbWU6MTQ%3D %3DMzA1NTA6REFVR0hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5 DOjMw
---------------------------------------------------------------

I know what the named items in the QueryString are and accurately
Base64 encode them so that I see the text in the QueryString. But when
I try to get the matching value from the QueryString, I get an empty
string returned.

Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ%3D") = ''
Request.QueryString("MTAwMjg6cHJvZFByb2R1Y2VySUQ6M TQ=") = ''
I tried looping through the name/value pairs in the QueryString but it
seems to think the entire QueryString is 1 named item with no value. I
put single quotes around each name and each value and got the
following:

'MTAwMjg6cHJvZFByb2R1Y2VySUQ6MTQ==MjM3MzpiMTcxODYw Ojc=&NzQzMTpwcm9kQWdlbmN5S UQ6MTI==MjcxNjowMDUxMjIwODo4&MTA0MjE6cHJvZEFnZW5je U5hbWU6MTQ==MzA1NTA6REFVR0 hFUlRZICYgQ08gSU5TIEJST0tFUlMgSU5DOjMw'
= ''
Any ideas how I can parse out each Base64-encoded name to to get the
matching Base64-encoded value?

Thanks,
Michael Levy


Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.