Entity Framework Encrypt Connection String

后端 未结 1 1252
無奈伤痛
無奈伤痛 2020-12-16 05:36

I use Entity Framework and Linq to Entities. I want to encrypt the connection string and the EF has to decrypt automaticaly, How can I do it?

Thanks in advance,

相关标签:
1条回答
  • 2020-12-16 06:26

    Use aspnet_regiis. In command line browse to (usually):

    cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
    

    and type:

    aspnet_regiis -pef "sectionName of web.config" "path" - to encrypt
    aspnet_regiis -pdf "sectionName of web.config" "path" - to decrypt
    

    For example:

    aspnet_regiis -pef "connectionStrings" "D:\projects\HelloWorldProject"
    

    You don't need to do anything to make L2SQL read ecrypted connection string file.

    0 讨论(0)
提交回复
热议问题