我最近看到了一篇文章,介绍了在web.config文件中加密connectionString标签的过程:
http://chiragrdarji.wordpress.com/2008/08/11/how-to-encrypt-connection-string-in-webconfig/
我使用了相同的方法来加密包含我的加密密钥的web.config文件中的appSettings标签。
我的问题是,如果我把项目交给另一个人在不同的机器上运行,他们能否使用aspnet_regiis工具反向解密web.config文件中的appSettings标签?如果不能,该项目是否仍能在其计算机上正常工作?
这是我在代码中检索加密密钥的方式:
string block_size = ConfigurationManager.AppSettings["rgbIV"];
string encryption_key = ConfigurationManager.AppSettings["key"];