Encrypting sections of an exe.config file


  • I need to encrypt a certain section of my Service.exe.config file. The information to be encrypted is sensitive. So I can't leave it in plain text format. I have gone through the ProtectSection and UnprotectSection methods and I want to know more about how it works. I have specific questions about it. I am using these methods but my understanding is that as long as I run my service as an administrator and encrypt it, I will always be able to see the decrypted data. But if another user logs in his account, he cannot see the encrypted data in the config file. Am I correct in assuming this? If not, where am I wrong? 

    Also, which would be the better way to do it? Using the above mentioned methods or aspnet_regiis through the command line? 

    Any help would be greatly appreciated. 



    Tuesday, April 4, 2017 9:48 AM

All replies