Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to crypt my URL

How to crypt my URL

Scheduled Pinned Locked Moved ASP.NET
dotnettutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TRAORE cheickna
    wrote on last edited by
    #1

    Hello, To open many aspx pages in my application il use parameters and sometimes the user name and password as required. For instance :

    Response.Redirect("subscribe.aspx?From=LoginUser&UserName=" & txtUserName.Text & "&UserEmail=" & txtEmail.Text & "&UserPassword=" & txtPassword.Text)

    the probem is that after running this code the URL become :

    Response.Redirect("subscribe.aspx?From=LoginUser&UserName="toto" &UserEmail=" toto@yahoo.fr"&UserPassword="totototo")

    You undertand this is not a ggod thing because user can see theses information and worse google can record thes infos. Is there any way to crypt URL Informations? Thanks in advance

    M 1 Reply Last reply
    0
    • T TRAORE cheickna

      Hello, To open many aspx pages in my application il use parameters and sometimes the user name and password as required. For instance :

      Response.Redirect("subscribe.aspx?From=LoginUser&UserName=" & txtUserName.Text & "&UserEmail=" & txtEmail.Text & "&UserPassword=" & txtPassword.Text)

      the probem is that after running this code the URL become :

      Response.Redirect("subscribe.aspx?From=LoginUser&UserName="toto" &UserEmail=" toto@yahoo.fr"&UserPassword="totototo")

      You undertand this is not a ggod thing because user can see theses information and worse google can record thes infos. Is there any way to crypt URL Informations? Thanks in advance

      M Offline
      M Offline
      Morgs Morgan
      wrote on last edited by
      #2

      There are many ways you can escape such a not too cool practice. 1. Put your parameters in a separate session object and access it on the other page, e.g.

      Session[ "UserName" ] = "toto";
      Session[ "UserEmail" ] = "toto@yahoo.fr";
      Session[ "UserPassword" ] = "totototo";

      //redirect to your page like so:
      Response.Redirect( "subscribe.aspx?From=LoginUser" );

      Go here and find out more of this stuff: http://msdn.microsoft.com/en-us/library/ms178581.aspx[^] 2. Put your parameters in a separate cookie object and access it on the other page, e.g.

      Response.Cookie[ "UserName" ].Value = "toto";
      Response.Cookie[ "UserEmail" ].Value = "toto@yahoo.fr";
      Response.Cookie[ "UserPassword" ].Value = "totototo";

      Go here and find out more of this stuff: http://msdn.microsoft.com/en-us/library/ms178194.aspx[^] 3. Using the handy to manage Cache object: http://msdn.microsoft.com/en-us/library/aa478965.aspx[^] 4. You can keep it as you wanted by encrypting your parameters and you could: a. Convert to base64 http://msdn.microsoft.com/en-us/library/dhx0d524.aspx[^] b. MD5 hash http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx[^] But again, you don't want to put sensitive information in your url as people can decode it, which is why i would recommend the first 3 options. Happy coding, Morgs

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups