How do you all encrypt connection strings in WEB.CONFIG? TIA.
*** Read the sticky in the DB forum about how to get your question answered quickly!! *** Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post". Some Informative Links: [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ] [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ] MS MVP 2006, 2007, 2008
Found this link - and it worked perfectly https://techcommunity.microsoft.com/...on/ba-p/830094 Run Command Prompt as Administrator Go to C:\Windows\Microsoft.NET\Framework\v4.0.30319 Perform the command below to encrypt the connection string in your web.config: ASPNET_REGIIS -pef "connectionStrings" "D:\inetpub\wwwroot\applicationFolder" Open web.config and check if the connection string is encrypted Test the site If you want to decrypt it back, run this command: ASPNET_REGIIS -pdf "connectionStrings" "D:\inetpub\wwwroot\applicationFolder" Open the web.config and check if the connection string is decrypted
This is what I used to do when I worked with asp.net Note that I remember that this could work also with app.config but it's been sometimes so I'm not saying this with 100% certainty. Also note that I'm not sure that you can decrypt on another server machine like that, so you might also want to read this: https://docs.microsoft.com/en-us/pre...ectedfrom=MSDN https://social.msdn.microsoft.com/Fo...csharplanguage
ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·
Forum Rules