redirect url can't contain newline characters - encrypted query string

1,132 views
Skip to first unread message

Sue Stoos

unread,
Nov 3, 2012, 11:27:22 AM11/3/12
to didisof...@googlegroups.com

Hello,

I'm currently trying your product and like what I see so far.  However, I am new to Encryption and need to send the string that was generated by the pgp.EncryptString method in a querysting.  I used a key from my client and am not able to use it to decrypt the information I need to send.  The

When I append the encrypted string to the url, I receive the following error:  Error received: System.ArguementException     {"Redirect URI cannot contain newline characters."}

 The encrpted string that I'm trying to send looks similar to:

"-----BEGIN PGP MESSAGE----- Version: BCPG C# v1.7.4114.6378  hQIOA+nqApdgUx5pEAf+LdWa3c4lmoNbZyoJT0BKt+4LQ/6RvY5IvQcOGWN7+hRW sMm7DShFlNPaKcC+NyyOioCRjZoL1mAQrE8dcm9mwn+v91bDRhEiLV29t7+6UldJ BzdHE4QzELMo+NvX8zFAe8228lIrZdvQ77Dex/4W9cKDJA/TWVOobGVWyPx3H+Jb aKJPPBkHkBNnBwcyXZ0MZViDn2x2ltzw9gpcL4HJroTyf1FQf6Q22Q5+uAFdUQcy NsaAq9IBQIX3/CJiLunYmOKX0dMiN3oCn4l0uTtdvHsiNmm/KdVwWA6CJqP85w== =7LiY -----END PGP MESSAGE----- "

 Also, here is my code used to encrypt the string, with some moderaton to not display true data:  The language is VB.net

strLogin as string

strEcpt as string

strlogin ="empid=1122334455" & Today.date & "group=1234" 

 strExpt = pgp.EncryptString(strlogin, keystore, "ID")

response.redirect("https://sitename.com/sso.asp?" & strExpt) - Get error as soon as I hit try to redirect to client page.

 I'm in a time crunch to complete this so any help would be extremely appreciated!!!

Thanks for your time.

didisoft

unread,
Nov 4, 2012, 11:40:53 AM11/4/12
to didisof...@googlegroups.com
Hi Sue,

One possible soluton to this situation can be to encode the encrypted string using the HttpUtility.UrlEncode method.
For example:


response.redirect("https://sitename.com/sso.asp?" & Server.UrlEncode(strExpt))

Of course your recipint MUST decode it before decrypting with UrlDecode.

For more information, please check

For url decode for the old pre-.NET ASP check

Please also have in mind that the url is limited by the browser.

Best regards,
Katerina
Reply all
Reply to author
Forward
0 new messages