Hello,
I have a small architectal or development problem.
My application must store some confidential information (for example, public
key) on the end user's computer, that accessible only for my application (and
not available for other applications).
End user may be a local administrator on own computer.
Target system is Windows 2000 Professional.
How I can this realize, and where store this secret? Thanks!
Dominick Baier [DevelopMentor] - 16 Oct 2005 19:16 GMT
Hello Whistler,
you can use DPAPI - a encryption mechanism built into Windows. Secrets can
be stored machine and user specific - even with some application supplied
entropy.
in 2.0 this is available via System.Security.Cryptography.ProtectedData
you can download a wrapper for 1.1 here:
http://www.leastprivilege.com/DPAPITools.aspx
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
> Hello,
> I have a small architectal or development problem.
[quoted text clipped - 6 lines]
> Target system is Windows 2000 Professional.
> How I can this realize, and where store this secret? Thanks!
Whistler - 16 Oct 2005 21:55 GMT
But, what will be a source of entropy? If i'll store some value (entropy
"generator") in the body of assembly, then security of data, saved in system
protected storage will be minimal. User may disassembly code, extract this
value, and also extracts my secret.
DPAPI is user/machine specific, but I need assembly specific alternative...
Sorry for my English :-)
Dominick Baier [DevelopMentor] - 17 Oct 2005 10:22 GMT
Hello Whistler,
you will always have this problem. Encryption does not eliminate secrets
- it only compresses them to a key. Your application has to have access to
that key somehow. So if someone decompiles the application he will find out
where the key is.
---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com
> But, what will be a source of entropy? If i'll store some value
> (entropy "generator") in the body of assembly, then security of data,
[quoted text clipped - 5 lines]
>
> Sorry for my English :-)
William Stacey [MVP] - 17 Oct 2005 16:34 GMT
Why do you need to encyrpt public key? These are public and meant to be
known. If you want to store some encypted data in the assem in supporting
file, only way to do is ask for a password in the app and decrypt. Wrong
password will throw error doing decrypt. You could use dpapi, but you would
need the clear text to begin with.

Signature
William Stacey [MVP]
> Hello,
> I have a small architectal or development problem.
[quoted text clipped - 8 lines]
>
> How I can this realize, and where store this secret? Thanks!