{"id":1212,"date":"2015-06-29T12:53:56","date_gmt":"2015-06-29T15:53:56","guid":{"rendered":"http:\/\/www.franklinjr.com\/blog\/?p=1212"},"modified":"2015-06-29T12:54:49","modified_gmt":"2015-06-29T15:54:49","slug":"encriptografar-e-descriptografar-secao-no-web-config","status":"publish","type":"post","link":"https:\/\/www.franklinjr.com\/blog\/index.php\/2015\/06\/29\/encriptografar-e-descriptografar-secao-no-web-config\/","title":{"rendered":"Encriptografar e descriptografar se\u00e7\u00e3o no web.config"},"content":{"rendered":"<p>1) Abra o prompt de comando<br \/>\n2) Altere o diret\u00f3rio para a vers\u00e3o do asp.net que voc\u00ea usa<\/p>\n<pre lang=\"typoscript\">cd %windir%\\Microsoft.NET\\Framework\\versao\r\n<\/pre>\n<p>3) Rode o comando alterando a se\u00e7\u00e3o que quer utilizar e o site utilizado<\/p>\n<pre lang=\"typoscript\">aspnet_regiis -pe \"connectionStrings\" -app \"\/\" -site \"batatinha.com.br\"\r\n<\/pre>\n<p>no exemplo a cima, vamos criptografar a se\u00e7\u00e3o &#8220;connectionStrings&#8221; para a aplica\u00e7\u00e3o raiz do site &#8220;batatinha.com.br&#8221;<\/p>\n<p>4) Abra o web.config do site, ver\u00e1 que haver\u00e1 algo do tipo<\/p>\n<pre lang=\"dot\">  \r\n<connectionStrings configProtectionProvider=\"RsaProtectedConfigurationProvider\">\r\n  <EncryptedData Type=\"http:\/\/www.w3.org\/2001\/04\/xmlenc#Element\"\r\n   xmlns=\"http:\/\/www.w3.org\/2001\/04\/xmlenc#\">\r\n   <EncryptionMethod Algorithm=\"http:\/\/www.w3.org\/2001\/04\/xmlenc#tripledes-cbc\" \/>\r\n   <KeyInfo xmlns=\"http:\/\/www.w3.org\/2000\/09\/xmldsig#\">\r\n    <EncryptedKey xmlns=\"http:\/\/www.w3.org\/2001\/04\/xmlenc#\">\r\n     <EncryptionMethod Algorithm=\"http:\/\/www.w3.org\/2001\/04\/xmlenc#rsa-1_5\" \/>\r\n     <KeyInfo xmlns=\"http:\/\/www.w3.org\/2000\/09\/xmldsig#\">\r\n      <KeyName>Rsa Key<\/KeyName>\r\n     <\/KeyInfo>\r\n     <CipherData>\r\n      <CipherValue>n\/zynKbSuIPDiyR44df1zZcDJSTfND7qQ8vduh83yEU0GcI+fD3LHdFcAkMZyfHfnsKpfMXf6F3zd4UyDjSJDBduN17xe0COGLyrivFifFtw1VcpRHLwR+z9MF9yVyi9a2Sbj5YO8nU50zJgOnN53GaM5KEZIT0abO2l0koo=<\/CipherValue>\r\n     <\/CipherData>\r\n    <\/EncryptedKey>\r\n   <\/KeyInfo>\r\n   <CipherData>\r\n    <CipherValue>P4+kFEJ5\/rXZp9edsksmVRg\/Jo2zZCuHR3103Tooy4AnX+WzawGHuA6HL6+9ULw1s7Wd+TCsfSO74befVnTCuYS6NFMQg+FtMdK0rtey9ryia0lyqccf4CZ4u2U9afqNcO6eN40rPvY8SVG5AbQ37VatWuhs8pu1ZfpN8hQjL3aeM3nXudXcLxU4YUf84oTsHf1Q8hGUDc2mnKQqpfU7jDNhDp8hmobV1Xb3q9DQPxD3k2eCKE+vD1ZXvHK8o7TuioZxv\/TXUIX\/ewc1pWzH3AdQJUSGhjJHAUUJ7pC4WYdNVwpB32NLokiR3gBOAmClHDqlRVrJ+yzoTZnfonBGPKjQT0q6Kxi5fsQUCRbG9rXe9SrIHGL1G3yE62R2lMO1dx6A+9mLiR3F82bKH5oJrrhmFrTjuCnLaYVhrTtWAWC8CAJ6fs5wk4dKg8fvcVNoIFKkHVyEgf8Wqvf0MRiGwfsob5tTNc15yfUZS5w6AnyWNqHrS1d\/\/WTcJ++G5EXZdkDE7KxiDEisokflrtDIq+VC6zC3zcOH18H4h0UL1L5zlcMdHRvSJ2YlI0k4en1Dm3w05fzFf9Z5Sk7CS+NZjLl2jWT5m3ZBMiGBUORi0NYD8ThHkvuy9AwogQ\/T8b+uj9o4Q3HwEqpSDMs0t0T7Izx7ISTan+OH58MgOPZ6Qq1gV\/LqcGBTHqeojZzy5frlKTxMWokW2PXexHkyyW6vAEqOzYoXn5ctuuL8VfbQhut3Xlq6wbYD7jZh4gzxJJ1BbpEsGqr8YCRIMkhcju4dzHgHI\/ks1dmAwWwOUFVjnsx2ZNrmo4kWk8HaujUybekdcWxstMXB1Jor6EB3dLYgoxQ74oetIAOmHIH93bE17MUEO1Yer9PTy0qU17cXl3EMZX\/bGfYlppzh69WeszQ0\/63IeBoPaoaWZaLgqMlogDntjdnQWqOA+goiKMSlqv9qWIdjdsZ63Ekhuc1H58qJrjPkJYvVjoGApECgvDtRBN8BcFaflMWzX+GxL0NCvi4poQiuSsD58\/j1I0rl4kTUzA499s+uYy8WuX7OVh6gbXzlaSBvqj08+VtA+ewqW8S5bcPQdiG8EjAj1Be6VPc8qJb43H9JJF\/8BtQ7ve+w=<\/CipherValue>\r\n   <\/CipherData>\r\n  <\/EncryptedData>\r\n <\/connectionStrings>\r\n<\/pre>\n<p>Feito \ud83d\ude00<\/p>\n<p>Para descriptografar, fa\u00e7a o seguinte:<\/p>\n<p>1) Abra o prompt de comando<br \/>\n2) Altere o diret\u00f3rio para a vers\u00e3o do asp.net que voc\u00ea usa<\/p>\n<pre lang=\"typoscript\">cd %windir%\\Microsoft.NET\\Framework\\versao\r\n<\/pre>\n<p>3) Rode o comando alterando a se\u00e7\u00e3o que quer utilizar e o site utilizado<\/p>\n<pre lang=\"typoscript\">aspnet_regiis -pd \"connectionStrings\" -app \"\/\" -site \"batatinha.com.br\"\r\n<\/pre>\n<p>No exemplo a cima vamos descriptografar a se\u00e7\u00e3o &#8220;connectionStrings&#8221; para a aplica\u00e7\u00e3o raiz do site &#8220;batatinha.com.br&#8221;<\/p>\n<p>Cr\u00e9ditos: <a href=\"https:\/\/support.transfrm.com\/entries\/27430158-Encrypting-Decrypting-the-database-connection-strings-in-web-3-0\" target=\"_blank\">https:\/\/support.transfrm.com\/entries\/27430158-Encrypting-Decrypting-the-database-connection-strings-in-web-3-0<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1) Abra o prompt de comando 2) Altere o diret\u00f3rio para a vers\u00e3o do asp.net que voc\u00ea usa cd %windir%\\Microsoft.NET\\Framework\\versao 3) Rode o comando alterando a se\u00e7\u00e3o que quer utilizar e o site utilizado aspnet_regiis -pe &#8220;connectionStrings&#8221; -app &#8220;\/&#8221; -site &#8220;batatinha.com.br&#8221; no exemplo a cima, vamos criptografar a se\u00e7\u00e3o &#8220;connectionStrings&#8221; para a aplica\u00e7\u00e3o raiz do [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[427,425,51],"tags":[570,569,423],"class_list":["post-1212","post","type-post","status-publish","format-standard","hentry","category-asp-net","category-iis","category-windows","tag-asp-net","tag-iis","tag-windows-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\r\n<title>Encriptografar e descriptografar se\u00e7\u00e3o no web.config - Franklin Jr.<\/title>\r\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\r\n<link rel=\"canonical\" href=\"https:\/\/www.franklinjr.com\/blog\/index.php\/2015\/06\/29\/encriptografar-e-descriptografar-secao-no-web-config\/\" \/>\r\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.franklinjr.com\\\/blog\\\/index.php\\\/2015\\\/06\\\/29\\\/encriptografar-e-descriptografar-secao-no-web-config\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"In\u00edcio\",\"item\":\"https:\\\/\\\/www.franklinjr.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Encriptografar e descriptografar se\u00e7\u00e3o no web.config\"}]}]}<\/script>\r\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Encriptografar e descriptografar se\u00e7\u00e3o no web.config - Franklin Jr.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.franklinjr.com\/blog\/index.php\/2015\/06\/29\/encriptografar-e-descriptografar-secao-no-web-config\/","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/www.franklinjr.com\/blog\/index.php\/2015\/06\/29\/encriptografar-e-descriptografar-secao-no-web-config\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"In\u00edcio","item":"https:\/\/www.franklinjr.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Encriptografar e descriptografar se\u00e7\u00e3o no web.config"}]}]}},"_links":{"self":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1212","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=1212"}],"version-history":[{"count":7,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1212\/revisions"}],"predecessor-version":[{"id":1220,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/1212\/revisions\/1220"}],"wp:attachment":[{"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=1212"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=1212"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.franklinjr.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=1212"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}