DPAPI

J

juan

I am trying to use the DPAPI for encryption of some string data. I took the
code right from the MSDN example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/secnetht07.asp

Encryption goes off without any issues, but when I try to decrypt I get the
following error: Decryption Failed: Unable to update the password. The
value provided for the new password does not meet the length, complexity or
history requirement of the domain.

I tried running my DLL from an ASP.NET page or a .NET app with the same
results. I then turned on user interface and it poped up a dialog on
decryption and I said allow it and decryption still failed.

Do I have something restricting me here on my machine or on my network?
Currently I am just trying to run on my own machine with using the machine
store (I tried user store and it didn't help). I searched around and didn't
find anyone with this same issue. Everyone seemed to just point to the
articles and they acted like it just worked.

Any insights would be appreciated.
 
L

Luke Zhang [MSFT]

Hello,

Did you try it in a windows form application? And DPAPI can work with
either the machine store or user store (which requires a loaded user
profile). DPAPI defaults to the user store, although you can specify that
the machine store be used by passing the CRYPTPROTECT_LOCAL_MACHINE flag to
the DPAPI functions. Have you done this?


Luke
 
J

juan

Yes, I tried both. I started with machine store, because that is what I was
interested in doing in my application.
 
J

Jim Andersen

Yes, I tried both. I started with machine store, because that is what I
was
interested in doing in my application.

Try hitting the Decrypt button a couple of times. See if the errormessage
changes. I had the same problem yesterday.....

I will check my code and see what I did tomorrow (if noone beats me to it).
Im going home now.

/jim
 
J

juan

A fresh start in the morning always helps.

I saw I was getting the encoding messed up, too much cut and paste in my
test sample. So I am working fine.

Thanks for all of your replies.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,130
Latest member
MitchellTe
Top