【发布时间】:2018-09-23 18:48:52
【问题描述】:
阅读这篇文章http://tutorialslink.com/Articles/Encrypt-and-Decrypt-Connection-Strings-in-Webconfig/52
他们说如果我们使用这个命令,那么连接字符串将被加密aspnet_regiis.exe -pef "connectionStrings" "<Path of the Folder containing the Web.Config file>" 并且
说这个命令将解密连接字符串aspnet_regiis.exe -pdf "connectionStrings" "<Path of the Folder containing the Web.Config file>"
但问题是,如果我们采用这种方法,当我们在不同的电脑上托管我们的网站时,它可能无法正常工作。
所以请告诉我我们应该采用什么方法来加密/解密 连接字符串或 web.config 中的任何部分,这将适用于任何电脑。
提前致谢。
【问题讨论】:
-
你为什么要首先这样做?无论如何,连接字符串应该对外部隐藏。
-
我想这样做,即使任何人都可以破解 web.config 他们将无法轻松读取数据库连接详细信息。
标签: asp.net encryption web-config