Encrypting Web.Config

后端 未结 6 2210
再見小時候
再見小時候 2020-11-28 06:34

Duplicate of Encrypting config files for deployment .NET and Encrypting config files for deployment


What is the best approach and tools for encrypting informat

6条回答
  •  被撕碎了的回忆
    2020-11-28 07:08

    I believe there are two ways of doing this:

    using aspnet_regiis using DPAPI or RSA, or doing it programmatically.

    The programmatic way can be handy, particularly if you also like to encrypt app.config.

    From my experiences of using this, if you write a custom configuration section, you have install the DLL containing the classes for that section into the GAC. For a project I was working I basically scripted the following approach:

    • Copy config DLL to GAC.
    • Perform encryption.
    • Remove config DLL from GAC.

    Chances are if you are just encrypting connection strings then this won't be a problem. You also need to be bear in mind whether you want to encrypt on a machine wide basis or to a specific user account- both options can be useful depending on your scenario. For simplicity I stuck to machine wide encryption. The links I have provided explain the merits of both approaches.

提交回复
热议问题