Click here to Skip to main content
15,072,776 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi Guys,

I am working on a mvc application , where i need to sent some values as querystrings.

I used Base 64 encryption to encrypt the querystrings and also used html encoding techniques to encode and decode the querystrings.

It's working fine for some variables but when it gets a value "/" or "+" in the query string , mvc straight forward throughs an error saying "resource not found".

How can i restrict the Base64 to only generate text without the special characters.

Or is there any other ways of encryption which i can use.

Please help me guys, its killing my time...

thank you
Posted

You have to use a variation of that encoding like base64url: http://fr.wikipedia.org/wiki/Base64[^]

I don't think ASP.NET directly support that encoding. You can write your own functions or for do that encoding and then encode for URL.

Anyway to do it cleanly in MVC, you will probably have to override a bunch of stuff.

Are you doing all the encoding by hand or have you expanded MVC to support that?
   
Base64 is a string Encoding scheme and not an Encryption technique.

Not only in Asp.Net-MVC but in any Web-Development Technology character like "/"(in QueryString) gives altogether different meaning to the existing Url.

Have a look at below links for Query string encryption in ASP.NET.

Query string encryption for ASP.NET

http://www.dotnetfunda.com/articles/article748-url-encryption-in-aspnet-.aspx

Also have a look at below link for "Asp.Net Sessions".

http://msdn.microsoft.com/en-us/library/ms178581.aspx
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900