DPAPI failing with user store (revisited)

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

  1. #1

    Default 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 and have ran into problems
    [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]

    the encryption and decrpytion works fine on my dev machine utilising a
    domain user account but when i transfered my app to another server things
    went wrong, the decrytption is failing...

    the error thrown is as follows :

    Exception decrypting. Exception decrypting. Decryption failed. Key not valid
    for use in specified state.

    this would suggest to me that the machine store method is being utilised
    rather that the user store but this is definately not the case...

    thank you very much in advance for any help...

    - jd
    Jason Duckers Guest

  2. Similar Questions and Discussions

    1. 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...
    2. DPAPI User Store Does Not Work as advertised
      http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp I am following the above article to implement DPAPI...
    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. New User Script Failing Unexpectedly.
      Okay, this is a tricky one (i think so, anyway!), and rather long but pleeeeeeeease help me! I don't expect you to spend hours looking at the...
  3. #2

    Default DPAPI failing with user store (revisited)

    you can't use UserStore in an ASP.NET application -

    the DPAPI key for users is stored in the users' profile. ASP.NET does not load the userprofile for performance reasons (there is a LoadProfile win32 API - but it requires SYSTEM privs). so - you have to use the MachineStore.

    Dominick Baier - DevelopMentor
    [url]http://www.leastprivilege.com[/url]

    nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<A6AD0F2D-9A27-4BFB-879C-65B27D273D7B@microsoft.com>

    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 and have ran into problems : [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]

    the encryption and decrpytion works fine on my dev machine utilising a
    domain user account but when i transfered my app to another server things
    went wrong, the decrytption is failing...

    the error thrown is as follows :

    Exception decrypting. Exception decrypting. Decryption failed. Key not valid
    for use in specified state.

    this would suggest to me that the machine store method is being utilised
    rather that the user store but this is definately not the case...

    thank you very much in advance for any help...

    - jd

    [microsoft.public.dotnet.framework.aspnet.security]
    Dominick Baier Guest

  4. #3

    Default RE: DPAPI failing with user store (revisited)

    did you read the article in my link? that is precisely why the dpapi is
    called from a serviced component which runs under a known domain user account


    "Dominick Baier" wrote:
    > you can't use UserStore in an ASP.NET application -
    >
    > the DPAPI key for users is stored in the users' profile. ASP.NET does not load the userprofile for performance reasons (there is a LoadProfile win32 API - but it requires SYSTEM privs). so - you have to use the MachineStore.
    >
    > Dominick Baier - DevelopMentor
    > [url]http://www.leastprivilege.com[/url]
    >
    > nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<A6AD0F2D-9A27-4BFB-879C-65B27D273D7B@microsoft.com>
    >
    > 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 and have ran into problems : [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]
    >
    > the encryption and decrpytion works fine on my dev machine utilising a
    > domain user account but when i transfered my app to another server things
    > went wrong, the decrytption is failing...
    >
    > the error thrown is as follows :
    >
    > Exception decrypting. Exception decrypting. Decryption failed. Key not valid
    > for use in specified state.
    >
    > this would suggest to me that the machine store method is being utilised
    > rather that the user store but this is definately not the case...
    >
    > thank you very much in advance for any help...
    >
    > - jd
    >
    > [microsoft.public.dotnet.framework.aspnet.security]
    >
    Jason Duckers Guest

  5. #4

    Default RE: DPAPI failing with user store (revisited)

    no..but this is the usual workaround - COM+ does load User Profiles...

    In whidbey we have the remoting IPC channel which is a nice alternative to Enterprise Services...

    Dominick - DevelopMentor
    [url]http://www.leastprivilege.com[/url]

    nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<04B5C3D2-735D-444F-8C2B-97844FBF8DC4@microsoft.com>

    did you read the article in my link? that is precisely why the dpapi is
    called from a serviced component which runs under a known domain user account


    "Dominick Baier" wrote:
    > you can't use UserStore in an ASP.NET application -
    >
    > the DPAPI key for users is stored in the users' profile. ASP.NET does not load the userprofile for performance reasons (there is a LoadProfile win32 API - but it requires SYSTEM privs). so - you have to use the MachineStore.
    >
    > Dominick Baier - DevelopMentor
    > [url]http://www.leastprivilege.com[/url]
    >
    > nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<A6AD0F2D-9A27-4BFB-879C-65B27D273D7B@microsoft.com>
    >
    > 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 and have ran into problems : [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]
    >
    > the encryption and decrpytion works fine on my dev machine utilising a
    > domain user account but when i transfered my app to another server things
    > went wrong, the decrytption is failing...
    >
    > the error thrown is as follows :
    >
    > Exception decrypting. Exception decrypting. Decryption failed. Key not valid
    > for use in specified state.
    >
    > this would suggest to me that the machine store method is being utilised
    > rather that the user store but this is definately not the case...
    >
    > thank you very much in advance for any help...
    >
    > - jd
    >
    > [microsoft.public.dotnet.framework.aspnet.security]
    >
    [microsoft.public.dotnet.framework.aspnet.security]
    Dominick Baier Guest

  6. #5

    Default RE: DPAPI failing with user store (revisited)

    ok sure thing...sounds good

    i have spent quite a bit fo time getting to where i am right now using dpapi
    from a serviced component...

    i only really want to change tactics if i really have to, like it aint gonna
    work...but thanks for the info

    "Dominick Baier" wrote:
    > no..but this is the usual workaround - COM+ does load User Profiles...
    >
    > In whidbey we have the remoting IPC channel which is a nice alternative to Enterprise Services...
    >
    > Dominick - DevelopMentor
    > [url]http://www.leastprivilege.com[/url]
    >
    > nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<04B5C3D2-735D-444F-8C2B-97844FBF8DC4@microsoft.com>
    >
    > did you read the article in my link? that is precisely why the dpapi is
    > called from a serviced component which runs under a known domain user account
    >
    >
    > "Dominick Baier" wrote:
    >
    > > you can't use UserStore in an ASP.NET application -
    > >
    > > the DPAPI key for users is stored in the users' profile. ASP.NET does not load the userprofile for performance reasons (there is a LoadProfile win32 API - but it requires SYSTEM privs). so - you have to use the MachineStore.
    > >
    > > Dominick Baier - DevelopMentor
    > > [url]http://www.leastprivilege.com[/url]
    > >
    > > nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<A6AD0F2D-9A27-4BFB-879C-65B27D273D7B@microsoft.com>
    > >
    > > 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 and have ran into problems : [url]http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT09.asp[/url]
    > >
    > > the encryption and decrpytion works fine on my dev machine utilising a
    > > domain user account but when i transfered my app to another server things
    > > went wrong, the decrytption is failing...
    > >
    > > the error thrown is as follows :
    > >
    > > Exception decrypting. Exception decrypting. Decryption failed. Key not valid
    > > for use in specified state.
    > >
    > > this would suggest to me that the machine store method is being utilised
    > > rather that the user store but this is definately not the case...
    > >
    > > thank you very much in advance for any help...
    > >
    > > - jd
    > >
    > > [microsoft.public.dotnet.framework.aspnet.security]
    > >
    >
    > [microsoft.public.dotnet.framework.aspnet.security]
    >
    Jason Duckers 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