Professional Web Applications Themes

Encryption for QueryString - ASP.NET Security

hi guyz. I want to put encryption for every querystring for my web application. for that right now i m using a custom function. can any body tell me if there is some builtin function available in .net which i can implement. wht i want is that the query string value should be sent in decrypted format and on the second page i catch this value and decrypt it and then use it appropriately. another problem i m having is that i cant apply encryption function on the "hyperlink" column of datagrid. normally in code 'sending response.redirect "somepage.aspx?id=" & encrypt(value) ...

  1. #1

    Default Encryption for QueryString



    hi guyz.

    I want to put encryption for every querystring for my web application.

    for that right now i m using a custom function.

    can any body tell me if there is some builtin function available in .net
    which i can implement.

    wht i want is that the query string value should be sent in decrypted
    format and on the second page i catch this value and decrypt it and then
    use it appropriately.

    another problem i m having is that i cant apply encryption function on
    the "hyperlink" column of datagrid.


    normally in code

    'sending
    response.redirect "somepage.aspx?id=" & encrypt(value)

    'getting
    dim strvalue as string = request.querystring("id")
    strvalue=decrypt(strvalue)

    but in datagrid, i can't find the way to do it.


    please also suggest if there is some alternative method to it.

    thankx in advance.










    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Raheel Hussain Guest

  2. #2

    Default Re: Encryption for QueryString

    Probably the easiest way to do this is to use the Aspnet_setreg.exe utility
    you can find at
    [url]http://support.microsoft.com/default.aspx?scid=kb;en-us;329290[/url]. Makes it
    easy to use encrypted connections strings in ASP.NET.

    Don

    "Raheel Hussain" <raheelphp> wrote in message
    news:OwzWQViREHA.1312TK2MSFTNGP12.phx.gbl...
    >
    >
    > hi guyz.
    >
    > I want to put encryption for every querystring for my web application.
    >
    > for that right now i m using a custom function.
    >
    > can any body tell me if there is some builtin function available in .net
    > which i can implement.
    >
    > wht i want is that the query string value should be sent in decrypted
    > format and on the second page i catch this value and decrypt it and then
    > use it appropriately.
    >
    > another problem i m having is that i cant apply encryption function on
    > the "hyperlink" column of datagrid.
    >
    >
    > normally in code
    >
    > 'sending
    > response.redirect "somepage.aspx?id=" & encrypt(value)
    >
    > 'getting
    > dim strvalue as string = request.querystring("id")
    > strvalue=decrypt(strvalue)
    >
    > but in datagrid, i can't find the way to do it.
    >
    >
    > please also suggest if there is some alternative method to it.
    >
    > thankx in advance.
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Don Kiely Guest

  3. #3

    Default Re: Encryption for QueryString

    For the encryption, you might want to try to use DPAPI (Data Protection API)
    which is a part of Windows 2000, XP and 2003.

    This article describes "How to create a DPAPI library":
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/secmod/html/secmod21.asp[/url]

    I do not know exactly what you should do about your datagrid problem. You
    might get the data into a dataset or datatable, then add an extra column
    containing the url's the way you want them, and then databind that
    table/dataset to the datagrid.

    Sincerely
    Svein Terje Gaup

    "Raheel Hussain" <raheelphp> wrote in message
    news:OwzWQViREHA.1312TK2MSFTNGP12.phx.gbl...
    >
    >
    > hi guyz.
    >
    > I want to put encryption for every querystring for my web application.
    >
    > for that right now i m using a custom function.
    >
    > can any body tell me if there is some builtin function available in .net
    > which i can implement.
    >
    > wht i want is that the query string value should be sent in decrypted
    > format and on the second page i catch this value and decrypt it and then
    > use it appropriately.
    >
    > another problem i m having is that i cant apply encryption function on
    > the "hyperlink" column of datagrid.
    >
    >
    > normally in code
    >
    > 'sending
    > response.redirect "somepage.aspx?id=" & encrypt(value)
    >
    > 'getting
    > dim strvalue as string = request.querystring("id")
    > strvalue=decrypt(strvalue)
    >
    > but in datagrid, i can't find the way to do it.
    >
    >
    > please also suggest if there is some alternative method to it.
    >
    > thankx in advance.
    >
    >
    >
    >
    >
    >
    >
    >
    >
    >
    > *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Svein Terje Gaup Guest

  4. #4

    Default RE: Encryption for QueryString

    There is nothing wrong with using your own en/decrpytion methods ... so long as you are using some of the built in classes in the System.Security.Cryptography namespace. Using the aspnet_setreg.exe utility will not help you with this, since it is intended to encrypt items from your web.config file and store them in the registry.

    The DPAPI may work, and does an excellent job of managing keys for you, but I have only seen that used in cases where you are encrypting items to be stored in the web.config file ... I have not seen it used for on the fly encryption, but I'm not saying it's not possible

    To answer your other question regarding encrypting the URL in the DataGrid, you could use the code behind support and select the column and set the URL appropriately, such as

    ((HyperLinkColumn) grid.Columns[0]).NavigateUrl = "mypage.aspx?id=" + encrypt(value)
    David Coe, MCP Guest

  5. #5

    Default RE: Encryption for QueryString



    the DPAPI helps a lot.

    Now i m gonna try it on the grid hyperlink field as David said.

    thx a lot guyz for the help.

    regards
    raheel

    *** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    Raheel Hussain Guest

Similar Threads

  1. QueryString Parameters
    By Ian Glenn in forum Dreamweaver AppDev
    Replies: 0
    Last Post: March 15th, 03:34 AM
  2. QueryString query
    By RH in forum ASP Database
    Replies: 8
    Last Post: February 17th, 04:10 AM
  3. QueryString Length
    By Ray at in forum ASP
    Replies: 4
    Last Post: September 22nd, 06:01 PM
  4. Calling from a QueryString
    By TGUK in forum Macromedia Flash
    Replies: 0
    Last Post: July 8th, 08:06 AM
  5. Pack QueryString
    By Axel Dahmen in forum ASP.NET General
    Replies: 3
    Last Post: June 29th, 02:48 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139