{"id":23,"date":"2015-12-11T07:30:51","date_gmt":"2015-12-11T07:30:51","guid":{"rendered":"http:\/\/windows.emacslisp.com\/?p=23"},"modified":"2015-12-11T07:32:03","modified_gmt":"2015-12-11T07:32:03","slug":"pet-shop-4-0-encrypt-webconfig-section-and-decrypt-webconfig-section-connectionstring","status":"publish","type":"post","link":"http:\/\/windows.emacslisp.com\/index.php\/2015\/12\/11\/pet-shop-4-0-encrypt-webconfig-section-and-decrypt-webconfig-section-connectionstring\/","title":{"rendered":"Pet Shop 4.0 &#8211; Encrypt WebConfig section and Decrypt WebConfig Section &#8220;ConnectionString&#8221;"},"content":{"rendered":"<p>As we know, <strong>ConnectionString contains User Name and Password.<\/strong><br \/>\nfor security reason, Connection String needed to be Encrypted.<\/p>\n<p>Here is sample code in Pet Shop.<\/p>\n<p><strong>EncryptWebConfig.bat<\/strong><br \/>\n@echo off<br \/>\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -pef &#8220;connectionStrings&#8221; &#8220;C:\\Program Files\\Microsoft\\.NET Pet Shop 4.0\\Web&#8221;<br \/>\nPAUSE<\/p>\n<p><strong>DecryptWebConfig.bat<\/strong><br \/>\n@echo off<br \/>\nC:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -pdf &#8220;connectionStrings&#8221; &#8220;C:\\Program Files\\Microsoft\\.NET Pet Shop 4.0\\Web&#8221;<br \/>\nPAUSE<\/p>\n<p>run EncryptWebConfig.bat the section will be like following:<\/p>\n<pre lang=\"html\" line=\"1\"> \r\n  <connectionStrings configProtectionProvider=\"RsaProtectedConfigurationProvider\">\r\n    <EncryptedData Type=\"http:\/\/www.w3.org\/2001\/04\/xmlenc#Element\"\r\n     ....         \r\n    <\/EncryptedData>\r\n  <\/connectionStrings>\r\n<\/pre>\n<p>run DecryptWebConfig.bat web.config will be normally displayed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we know, ConnectionString contains User Name and Password. for security reason, Connection String needed to be Encrypted. Here is sample code in Pet Shop. EncryptWebConfig.bat @echo off C:\\WINDOWS\\Microsoft.NET\\Framework\\v2.0.50727\\aspnet_regiis.exe -pef &#8220;connectionStrings&#8221; &#8220;C:\\Program Files\\Microsoft\\.NET Pet Shop 4.0\\Web&#8221; PAUSE DecryptWebConfig.bat @echo off &hellip; <a href=\"http:\/\/windows.emacslisp.com\/index.php\/2015\/12\/11\/pet-shop-4-0-encrypt-webconfig-section-and-decrypt-webconfig-section-connectionstring\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/posts\/23"}],"collection":[{"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":2,"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"predecessor-version":[{"id":25,"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/posts\/23\/revisions\/25"}],"wp:attachment":[{"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/windows.emacslisp.com\/index.php\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}