Store private key in cookie?

Ask a Question related to ASP.NET Security, Design and Development.

  1. #1

    Default Store private key in cookie?

    Greetings,

    I am working on an asp.net storefront that requires credit card information
    to be stored temporarily on the server. Currently the site will feature
    administrative access protected by MD5 and credit card information encrypted
    with Rijndael. Retrieving the information will also be secured by SSL.



    I've seen the question posed a few times but I have yet to see a definitive
    answer. How can I securely store the key/IV? From my readings the general
    consensus is, I can't. Using a MD5 password wont work because the customer
    would need to have access to the password when the information is initially
    encrypted and storing it in the binaries is a poor solution.



    I was thinking of using RSA to encrypt the Rijndael key/IV. My
    implementation would use the public key to encrypt them and then store the
    private key in a cookie on a trusted 'admin' machine. From what I
    understand SSL encrypts all traffic including cookies. To write the cookie,
    the admin might go to a specific page, paste in the xml key, and click write
    cookie. I could encode the cookie if necessary.



    Any ideas are appreciated.



    Bill


    Bill Belliveau Guest

  2. Similar Questions and Discussions

    1. HTTP::Cookie won't store sent cookie
      Hi all, My script requests http://foo.bar.com/ with code that looks a little like this: my $ua = LWP::UserAgent->new; my $cookie_jar =...
    2. store sessionID in cookie instead of url?
      when I start a session, php automatically adds a sessionid thing to my links. I see this as a security problem, since copy/paste of the URL could...
    3. Cookies set one time, I delete cookie, cookie is never set again!
      I am having this problem: My PHP script will set a cookie, it's there in my /Cookies folder. I delete the cookie (I have to for testing purposes,...
    4. authentication cookie vs session cookie
      Hi, What are the differences between authentication and session cookies? In my web.config file, I set the cookieless attribute for the...
    5. Private Fotopages - private Web Galleries WANTED!
      Hello NG I am still seeking links to private (hobby / non professional/ amateur) fotopages in Australia -or any other Country to be used at...
  3. #2

    Default Re: Store private key in cookie?

    Storing a key in a file somewhere is generally not a good idea, as you are
    not necessarily guaranteed of having correct security permissions on the
    drive + any admin could get the key (I'm not a big believer in admins seeing
    sensitive information, regardless of their rights). I'm not quite
    understanding the architecture of what you are mentioning, but if you want
    to store something like that, you could (and please someone correct me if
    this is not secure) store it in the session object. If you need to store
    the key long-term, XP has an API for storing sensitive information called
    the Data Protection API that stores sensitive information in some protected
    place in the registry. That should be a valid storage place, as it is
    recommended in MS Press' "Writing Secure Code" book.

    "Bill Belliveau" <noone@nowhere.com> wrote in message
    news:ON7MCjJfDHA.1760@TK2MSFTNGP09.phx.gbl...
    > Greetings,
    >
    > I am working on an asp.net storefront that requires credit card
    information
    > to be stored temporarily on the server. Currently the site will feature
    > administrative access protected by MD5 and credit card information
    encrypted
    > with Rijndael. Retrieving the information will also be secured by SSL.
    >
    >
    >
    > I've seen the question posed a few times but I have yet to see a
    definitive
    > answer. How can I securely store the key/IV? From my readings the
    general
    > consensus is, I can't. Using a MD5 password wont work because the
    customer
    > would need to have access to the password when the information is
    initially
    > encrypted and storing it in the binaries is a poor solution.
    >
    >
    >
    > I was thinking of using RSA to encrypt the Rijndael key/IV. My
    > implementation would use the public key to encrypt them and then store the
    > private key in a cookie on a trusted 'admin' machine. From what I
    > understand SSL encrypts all traffic including cookies. To write the
    cookie,
    > the admin might go to a specific page, paste in the xml key, and click
    write
    > cookie. I could encode the cookie if necessary.
    >
    >
    >
    > Any ideas are appreciated.
    >
    >
    >
    > Bill
    >
    >

    Keith Patrick Guest

  4. #3

    Default Re: Store private key in cookie?

    In fact, CryptoAPI keycontainers automatically make use DPAPI to
    protect private key credentials.
    Whenever possible, it is good practice to exercise use of available
    security infrastructure already provided to you, instead of trying
    to "roll your own" infrastructure.
    Cheers,
    - Mitch Gallant
    MVP Security
    [url]http://pages.istar.ca/~neutron[/url]

    "Keith Patrick" <richard_keith_patrick@hotmail.com> wrote in message
    news:%23Dn3d2VfDHA.3464@TK2MSFTNGP11.phx.gbl...
    > Storing a key in a file somewhere is generally not a good idea, as you are
    > not necessarily guaranteed of having correct security permissions on the
    > drive + any admin could get the key (I'm not a big believer in admins seeing
    > sensitive information, regardless of their rights). I'm not quite
    > understanding the architecture of what you are mentioning, but if you want
    > to store something like that, you could (and please someone correct me if
    > this is not secure) store it in the session object. If you need to store
    > the key long-term, XP has an API for storing sensitive information called
    > the Data Protection API that stores sensitive information in some protected
    > place in the registry. That should be a valid storage place, as it is
    > recommended in MS Press' "Writing Secure Code" book.
    >
    > "Bill Belliveau" <noone@nowhere.com> wrote in message
    > news:ON7MCjJfDHA.1760@TK2MSFTNGP09.phx.gbl...
    > > Greetings,
    > >
    > > I am working on an asp.net storefront that requires credit card
    > information
    > > to be stored temporarily on the server. Currently the site will feature
    > > administrative access protected by MD5 and credit card information
    > encrypted
    > > with Rijndael. Retrieving the information will also be secured by SSL.
    > >
    > >
    > >
    > > I've seen the question posed a few times but I have yet to see a
    > definitive
    > > answer. How can I securely store the key/IV? From my readings the
    > general
    > > consensus is, I can't. Using a MD5 password wont work because the
    > customer
    > > would need to have access to the password when the information is
    > initially
    > > encrypted and storing it in the binaries is a poor solution.
    > >
    > >
    > >
    > > I was thinking of using RSA to encrypt the Rijndael key/IV. My
    > > implementation would use the public key to encrypt them and then store the
    > > private key in a cookie on a trusted 'admin' machine. From what I
    > > understand SSL encrypts all traffic including cookies. To write the
    > cookie,
    > > the admin might go to a specific page, paste in the xml key, and click
    > write
    > > cookie. I could encode the cookie if necessary.
    > >
    > >
    > >
    > > Any ideas are appreciated.
    > >
    > >
    > >
    > > Bill
    > >
    > >
    >
    >

    Michel Gallant Guest

  5. #4

    Default Re: Store private key in cookie?

    A minor correction: DPAPI does not store anything anywhere (this is what LSA
    functions do); DPAPI just generates user or machine-specific keys and
    encrypts/decrypts data using these keys.

    It is rather hard to recommend any approach without knowing detailed
    requirements of the application and the infrastructure settings (and I
    cannot quite figure it out from your description). By the way, you don't
    really have to care about protecting IV; generally, IV is not a secret info,
    although it will not hurt if you do.

    If you want to get some idea about common options, which can be used to
    protect application secrets, check this article:
    [url]http://msdn.microsoft.com/msdnmag/issues/03/11/ProtectYourData/default.aspx[/url]
    (although, I doubt that it will tell you exactly what you need to do in your
    particular case).

    Alek

    "Keith Patrick" <richard_keith_patrick@hotmail.com> wrote in message
    news:%23Dn3d2VfDHA.3464@TK2MSFTNGP11.phx.gbl...
    > Storing a key in a file somewhere is generally not a good idea, as you are
    > not necessarily guaranteed of having correct security permissions on the
    > drive + any admin could get the key (I'm not a big believer in admins
    seeing
    > sensitive information, regardless of their rights). I'm not quite
    > understanding the architecture of what you are mentioning, but if you want
    > to store something like that, you could (and please someone correct me if
    > this is not secure) store it in the session object. If you need to store
    > the key long-term, XP has an API for storing sensitive information called
    > the Data Protection API that stores sensitive information in some
    protected
    > place in the registry. That should be a valid storage place, as it is
    > recommended in MS Press' "Writing Secure Code" book.
    >
    > "Bill Belliveau" <noone@nowhere.com> wrote in message
    > news:ON7MCjJfDHA.1760@TK2MSFTNGP09.phx.gbl...
    > > Greetings,
    > >
    > > I am working on an asp.net storefront that requires credit card
    > information
    > > to be stored temporarily on the server. Currently the site will feature
    > > administrative access protected by MD5 and credit card information
    > encrypted
    > > with Rijndael. Retrieving the information will also be secured by SSL.
    > >
    > >
    > >
    > > I've seen the question posed a few times but I have yet to see a
    > definitive
    > > answer. How can I securely store the key/IV? From my readings the
    > general
    > > consensus is, I can't. Using a MD5 password wont work because the
    > customer
    > > would need to have access to the password when the information is
    > initially
    > > encrypted and storing it in the binaries is a poor solution.
    > >
    > >
    > >
    > > I was thinking of using RSA to encrypt the Rijndael key/IV. My
    > > implementation would use the public key to encrypt them and then store
    the
    > > private key in a cookie on a trusted 'admin' machine. From what I
    > > understand SSL encrypts all traffic including cookies. To write the
    > cookie,
    > > the admin might go to a specific page, paste in the xml key, and click
    > write
    > > cookie. I could encode the cookie if necessary.
    > >
    > >
    > >
    > > Any ideas are appreciated.
    > >
    > >
    > >
    > > Bill
    > >
    > >
    >
    >

    Alek Davis Guest

Posting Permissions

  • You may not post new threads
  • You may 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