实体框架加密连接字符串

6 encryption entity-framework

我使用Entity Framework和Linq to Entities.我想加密连接字符串,EF必须自动解密,我该怎么做?

提前致谢,

Javier P. de Jorge

jlp*_*jlp 9

使用aspnet_regiis.在命令行中浏览到(通常):

cd C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727
Run Code Online (Sandbox Code Playgroud)

并输入:

aspnet_regiis -pef "sectionName of web.config" "path" - to encrypt
aspnet_regiis -pdf "sectionName of web.config" "path" - to decrypt
Run Code Online (Sandbox Code Playgroud)

例如:

aspnet_regiis -pef "connectionStrings" "D:\projects\HelloWorldProject"
Run Code Online (Sandbox Code Playgroud)

您无需做任何事情来使L2SQL读取ecrypted连接字符串文件.