1

Since this very important for every secure website to encrypt or encode its address bar URL to prevent end user from being viewing. How can I achieve this in asp.net at client side (by javascript). It should be display encoded URL but should work fine at server side. Means should decode appropriately. There are three questions you can provide answer for

  1. Encode or decode URL by javascript.

  2. Hide address bar

  3. Prevent copying of address bar

    Please share your views/Answer for any one of above as per your specification. It will helpful.

Thanks

Community
  • 1
  • 1
Rajaram Shelar
  • 7,537
  • 24
  • 66
  • 107

1 Answers1

0
  1. You can use encodeURIComponent(str) and encodeURI(str) functions for encoding URLs in java-script but I am not sure what purpose it would serve because URLs are still be valid and can be used by user. Some parts of it may get obfuscated as far as ordinary user is concerned but for any sophisticated user (who I guess would be your target for encoding scheme) could easily figure it out.

  2. While launching the browser window (popup) from java-script, you can show it without address bar. For example,

    var popup = window.open("http://someurl", "myPopup", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=120,height=120') But then its quite possible to have a browser that would allow to get the address bar back on some hot key or menu. Browser is the user agent and hence as such needs to allow user to control its UI rather than the content developer.

  3. AFAIK, you cannot prevent user copying the address bar text. Hiding or preventing address bar copying is anyway pointless as one can easily figure out address by checking page properties or say sniffing network etc.

All said, I simply don't understand the idea behind what you want to do because it does not seems to server any purpose as far as security goes.

VinayC
  • 47,395
  • 5
  • 59
  • 72