6

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,

Javier P. de Jorge

3
  • Is this a web app? ASP.NET has web.config encryption built in. Commented Aug 26, 2009 at 19:36
  • Yes, but how to do it or all is automatic even with the EF in the middle. Commented Aug 28, 2009 at 17:40
  • ASP.NET web.config encryption "just works." The EF won't care about it. Commented Aug 28, 2009 at 21:11

1 Answer 1

9

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.