DPAPI User Store Does Not Work as advertised

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

  1. #1

    Default DPAPI User Store Does Not Work as advertised

    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]

    I am following the above article to implement DPAPI User Store to
    store Credit Card Info in my database.

    I am doing exactly what the article says. I can encrypt and decrypt
    from the same machine but not from different machines…. What I have
    read is that if I have a roaming or a domain based user profile, I am
    able to do that. I have created a domain account that my win services
    on both machines and my COM+ compoenents also on both machines uses.
    Still no cigar.

    Any ideas?
    omar Guest

  2. Similar Questions and Discussions

    1. DPAPI failing with user store (revisited)
      first of all apologies if i am repeating posts but i am yet to find a satisfactory conclusion... i have followed these procedures to the letter...
    2. DPAPI
      Hi everyone. I'm creating an app that stores DB connection strings in the web config file. I'm using the MSDN resources at...
    3. pan machine dpapi user mode problems (roaming profiles & keys)
      Hi, I have a web app that uses dpapi in user mode. It's important that the keys are usable across more than one machine - in case of disaster...
    4. Further DPAPI (user store) problems
      Hi, I am trying to get the How To: Use DPAPI (User Store) from ASP.NET with Enterprise Services example working on my dev machine. Many thanks...
    5. Fit Selection in Window Doesn't Work As Advertised
      Dave-- Just for fun, I'd note that the zoom invoked by FreeHand and/or CorelDRAW! is also arbitrary. Sure, it fits the selection into the window,...
  3. #2

    Default Re: DPAPI User Store Does Not Work as advertised

    Take a look at this MSDN Magazine article that describe a component that
    tackles this problem.

    [url]http://msdn.microsoft.com/msdnmag/issues/04/11/CryptoUtility/default.aspx[/url]

    However an alternate approach to solve this issue (actually a key management
    topic) might somthing like this:
    1) Create a session key (might be a derived random entropy material)
    2) Protect this key with asymetric encryption (X509 Certificate installed on
    the app server that will do the encr/decr operations)
    3) Store this key on a central store
    4) All app server will get this key, decrpyt it with its locally
    public/private key pair (provided by the X509 Cert) and proceed to use this
    master key to do the ecryption/decryption operations.


    Hernan de Lahitte
    [url]http://weblogs.asp.net/hernandl[/url]


    "omar" <osaleh@usapsys.com> escribió en el mensaje
    news:c8d161a5.0411161713.5eb27fbd@posting.google.c om...
    > [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]
    >
    > I am following the above article to implement DPAPI User Store to
    > store Credit Card Info in my database.
    >
    > I am doing exactly what the article says. I can encrypt and decrypt
    > from the same machine but not from different machines.. What I have
    > read is that if I have a roaming or a domain based user profile, I am
    > able to do that. I have created a domain account that my win services
    > on both machines and my COM+ compoenents also on both machines uses.
    > Still no cigar.
    >
    > Any ideas?

    Hernan de Lahitte Guest

  4. #3

    Default Re: DPAPI User Store Does Not Work as advertised

    Thank you for your suggestion. However, it is Key Management that I am trying
    to avoid. My problem is that I have followed the guide from Microsoft exactly
    and I can encryt and decrypt, however, whatever I encrypt on one machine, i
    cannot decrypt on another machine even though I am running under the same
    profile as the How-To guide instructs. It seems like I am using the machine
    store. I am sure I am using the User Store but the behaviour is that of a
    user store.

    "Hernan de Lahitte" wrote:
    > Take a look at this MSDN Magazine article that describe a component that
    > tackles this problem.
    >
    > [url]http://msdn.microsoft.com/msdnmag/issues/04/11/CryptoUtility/default.aspx[/url]
    >
    > However an alternate approach to solve this issue (actually a key management
    > topic) might somthing like this:
    > 1) Create a session key (might be a derived random entropy material)
    > 2) Protect this key with asymetric encryption (X509 Certificate installed on
    > the app server that will do the encr/decr operations)
    > 3) Store this key on a central store
    > 4) All app server will get this key, decrpyt it with its locally
    > public/private key pair (provided by the X509 Cert) and proceed to use this
    > master key to do the ecryption/decryption operations.
    >
    >
    > Hernan de Lahitte
    > [url]http://weblogs.asp.net/hernandl[/url]
    >
    >
    > "omar" <osaleh@usapsys.com> escribió en el mensaje
    > news:c8d161a5.0411161713.5eb27fbd@posting.google.c om...
    > > [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]
    > >
    > > I am following the above article to implement DPAPI User Store to
    > > store Credit Card Info in my database.
    > >
    > > I am doing exactly what the article says. I can encrypt and decrypt
    > > from the same machine but not from different machines.. What I have
    > > read is that if I have a roaming or a domain based user profile, I am
    > > able to do that. I have created a domain account that my win services
    > > on both machines and my COM+ compoenents also on both machines uses.
    > > Still no cigar.
    > >
    > > Any ideas?
    >
    >
    >
    omar Guest

  5. #4

    Default Re: DPAPI User Store Does Not Work as advertised

    Hernan, can you please elaborate some more on the X509 Certificate approach
    you suggested? Are there any articles you can direct me to?

    "Hernan de Lahitte" wrote:
    > Take a look at this MSDN Magazine article that describe a component that
    > tackles this problem.
    >
    > [url]http://msdn.microsoft.com/msdnmag/issues/04/11/CryptoUtility/default.aspx[/url]
    >
    > However an alternate approach to solve this issue (actually a key management
    > topic) might somthing like this:
    > 1) Create a session key (might be a derived random entropy material)
    > 2) Protect this key with asymetric encryption (X509 Certificate installed on
    > the app server that will do the encr/decr operations)
    > 3) Store this key on a central store
    > 4) All app server will get this key, decrpyt it with its locally
    > public/private key pair (provided by the X509 Cert) and proceed to use this
    > master key to do the ecryption/decryption operations.
    >
    >
    > Hernan de Lahitte
    > [url]http://weblogs.asp.net/hernandl[/url]
    >
    >
    > "omar" <osaleh@usapsys.com> escribió en el mensaje
    > news:c8d161a5.0411161713.5eb27fbd@posting.google.c om...
    > > [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]
    > >
    > > I am following the above article to implement DPAPI User Store to
    > > store Credit Card Info in my database.
    > >
    > > I am doing exactly what the article says. I can encrypt and decrypt
    > > from the same machine but not from different machines.. What I have
    > > read is that if I have a roaming or a domain based user profile, I am
    > > able to do that. I have created a domain account that my win services
    > > on both machines and my COM+ compoenents also on both machines uses.
    > > Still no cigar.
    > >
    > > Any ideas?
    >
    >
    >
    omar Guest

  6. #5

    Default Re: DPAPI User Store Does Not Work as advertised

    Are you using "exactly" the same Credentials? it´s not the same to have
    THISMACHINE\pjutard than MYDOMAIN\pjutard

    Also be aware that in order to use the User Store, the User Profile must be
    loaded, so if you are not logged as the user but you are impersonating it in
    a a Windows Service you must be sure that the Profile exists, for this you
    MUST login at least once using this user credentials.

    Cheers,

    Patricio Jutard

    "omar" wrote:
    > Thank you for your suggestion. However, it is Key Management that I am trying
    > to avoid. My problem is that I have followed the guide from Microsoft exactly
    > and I can encryt and decrypt, however, whatever I encrypt on one machine, i
    > cannot decrypt on another machine even though I am running under the same
    > profile as the How-To guide instructs. It seems like I am using the machine
    > store. I am sure I am using the User Store but the behaviour is that of a
    > user store.
    Patricio Jutard Guest

  7. #6

    Default Re: DPAPI User Store Does Not Work as advertised

    Thank you Patricio. I am following the How-To guide to the letter except
    that I am using a domain account so that I will be able to use that across
    machines. So I am using one account with one password "domain/DPAPIAccount".
    And as to your other question, yes, I did log on with the domian account and
    a profile was created. Another thing I made sure is that when the service got
    started it actually forced the Serviced Component to start too. Any other
    sugestions?

    "Patricio Jutard" wrote:
    > Are you using "exactly" the same Credentials? it´s not the same to have
    > THISMACHINE\pjutard than MYDOMAIN\pjutard
    >
    > Also be aware that in order to use the User Store, the User Profile must be
    > loaded, so if you are not logged as the user but you are impersonating it in
    > a a Windows Service you must be sure that the Profile exists, for this you
    > MUST login at least once using this user credentials.
    >
    > Cheers,
    >
    > Patricio Jutard
    >
    > "omar" wrote:
    >
    > > Thank you for your suggestion. However, it is Key Management that I am trying
    > > to avoid. My problem is that I have followed the guide from Microsoft exactly
    > > and I can encryt and decrypt, however, whatever I encrypt on one machine, i
    > > cannot decrypt on another machine even though I am running under the same
    > > profile as the How-To guide instructs. It seems like I am using the machine
    > > store. I am sure I am using the User Store but the behaviour is that of a
    > > user store.
    omar Guest

  8. #7

    Default Re: DPAPI User Store Does Not Work as advertised

    Look at this extract from
    [url]http://msdn.microsoft.com/msdnmag/issues/04/11/CryptoUtility/default.aspx[/url] :

    "... to allow for encryption and decryption across multiple machines,
    roaming profiles must be enabled..."

    May be you should try roaming profiles...

    Please mantain me informed of your progress.

    Cheers & good luck



    "omar" wrote:
    > Thank you Patricio. I am following the How-To guide to the letter except
    > that I am using a domain account so that I will be able to use that across
    > machines. So I am using one account with one password "domain/DPAPIAccount".
    > And as to your other question, yes, I did log on with the domian account and
    > a profile was created. Another thing I made sure is that when the service got
    > started it actually forced the Serviced Component to start too. Any other
    > sugestions?
    >
    > "Patricio Jutard" wrote:
    >
    > > Are you using "exactly" the same Credentials? it´s not the same to have
    > > THISMACHINE\pjutard than MYDOMAIN\pjutard
    > >
    > > Also be aware that in order to use the User Store, the User Profile must be
    > > loaded, so if you are not logged as the user but you are impersonating it in
    > > a a Windows Service you must be sure that the Profile exists, for this you
    > > MUST login at least once using this user credentials.
    > >
    > > Cheers,
    > >
    > > Patricio Jutard
    > >
    > > "omar" wrote:
    > >
    > > > Thank you for your suggestion. However, it is Key Management that I am trying
    > > > to avoid. My problem is that I have followed the guide from Microsoft exactly
    > > > and I can encryt and decrypt, however, whatever I encrypt on one machine, i
    > > > cannot decrypt on another machine even though I am running under the same
    > > > profile as the How-To guide instructs. It seems like I am using the machine
    > > > store. I am sure I am using the User Store but the behaviour is that of a
    > > > user store.
    Patricio Jutard 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