I appreciate your post. Perhaps a lazy-yet-effective way to go would be to
Base64 encode the string. That would "raise the bar enough" to satisfy my
desire to simply not have clear text in App.Config while getting around the
additional difficulties of encrypting the text. Thoughts? (and yes - I know
Base64 encoding is not the same as encryption - not even close).
Merk
> I appreciate your post. Perhaps a lazy-yet-effective way to go would be to
> Base64 encode the string. That would "raise the bar enough" to satisfy my
> desire to simply not have clear text in App.Config while getting around the
> additional difficulties of encrypting the text. Thoughts? (and yes - I know
> Base64 encoding is not the same as encryption - not even close).
I had thought of that, too. That would defeat unsophisticated, curious
users. I'm hoping to raise the bar a little higher, though....
I'm reading the article to which I linked and there indeed appear to be
solutions for WinForms applications buried in there. Haven't read
enough to arrive at an answer, yet....
Garry - 12 Dec 2006 15:43 GMT
Did you find a satisfactory answer?
I would be grateful to know wot the details were??
Garry
>> I appreciate your post. Perhaps a lazy-yet-effective way to go would be
>> to
[quoted text clipped - 11 lines]
> solutions for WinForms applications buried in there. Haven't read
> enough to arrive at an answer, yet....
Bruce Wood - 12 Dec 2006 18:15 GMT
> Did you find a satisfactory answer?
>
> I would be grateful to know wot the details were??
I read the pages to which I linked. It appears that the only thing
available is to store an encrypted password in the App.config file and
store the key as a literal in your program, then decrypt at runtime.
I've seen several encryption schemes suggested (all built into .NET)
but I haven't actually tried it yet.
Most other (more secure) schemes appear geared for ASP.NET / WebForms,
in which the program either runs on only one machine, or runs on a farm
over which you have control. One article had a method for dealing with
the latter case: Put the key into a container file that you then
protect using ACLs, but this of course assumes that you have
administrative privileges on the client machines and have the time and
expertise to establish and maintain a bunch of ACLs.
For applications that can be deployed to any machine (including laptops
/ tablets / etc) but for which you need to store DB user IDs and
passwords, encrypting them and then storing the key as a literal inside
the app seems the only thing available. The best you can do is make the
config file difficult to read, and so ensure that the password isn't
stored in any permanent, visible location.
No, it's not secure. In particular, someone could sift through a memory
dump of the running program and find the decrypted password (and indeed
probably the entire connection string, complete with user ID and
password) in memory. However, I see no way around this. If anyone else
has any ideas, please do post them.
Shailen Sukul - 16 Jan 2007 05:04 GMT
The Patterns and Practices Crytography block has a quickstart application
based on Windows Forms that might prove useful. You can get the PP Block at:
http://msdn.microsoft.com/practices/guidetype/AppBlocks/

Signature
With Regards
Shailen Sukul
.Net Architect
(MCPD: Ent Apps, MCSD.Net MCSD MCAD)
Ashlen Consulting Services
http://www.ashlen.net.au
>
>> I appreciate your post. Perhaps a lazy-yet-effective way to go would be
[quoted text clipped - 12 lines]
> solutions for WinForms applications buried in there. Haven't read
> enough to arrive at an answer, yet....