Reputation: 2223
I am looking for simple file encryption method for .NET 2.0 similar to File.Encrypt but that will allow access to all the users that have administrative privileges on the system.
I would like not to use any symmetric/asymmetric encryption because of key management hassle that comes with it.
Is there any Windows OS API that can encrypt file and have transparent access for administrative users?
Please provide code example or link to example if it's .NET method.
Upvotes: 0
Views: 153
Reputation: 11597
What you are asking for is well suited to be handled by an ACL.
On windows, this means you just put the unencrypted file in a folder where only administrative users (or users of a specific role) have access to, by setting appropriate owner and read/write permissions.
Encryption always requires a key, somewhere, somehow.
EDIT: you can set access permissions programmatically after saving the file. Any file read (even File.ReadAllLines()
and the like) will simply fail if the application was started by a user without the necessary roles.
Upvotes: 1