web.config中的connectionstrins加密中的md5和sha1 [英] md5 and sha1 in encryption of connectionstrins in web.config

查看:158
本文介绍了web.config中的connectionstrins加密中的md5和sha1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以使用 md5和SHA1 算法对 web.config文件中的连接字符串进行加密.如果可以的话,请发布一些示例.
谢谢
srivas

解决方案

您不能使用MD5或SHA加密任何内容.

它们不是 加密 算法,而是 散列 算法.

区别在于加密算法是可逆的-您可以使用适当的密钥从输出中还原原始输入.散列算法 是不可逆的.您无法检索带有或不带有键的原始输入.

如果使用MD5或SHA来加密"连接字符串,则无法解密它们以再次获得需要的字符串. OriginalGriff解释了原因.
对于连接字符串加密,请参见以下CodeProject答案:
http://www.codeproject.com/search.aspx?doctypeid=5& q = encrypt + connection + string [ ^ ].

—SA


can i use md5 and SHA1 algorithm for encryption of connection strings in web.config file.if i can then please post some examples.
thanks
srivas

解决方案

You cannot use MD5 or SHA for encrypting anything.

They are not encryption algorithms, they are hashing algorithms.

The difference is that encryption algorithms are reversible - you can restore the original input from the output with an appropriate key. Hashing algorithms are not reversible. You cannot retrieve the original input, with or without a key.

If you use MD5 or SHA to "encrypt" your connection strings, you cannot decrypt them to get the string you need back again.


The question makes no sense; OriginalGriff explained why.

For connection string encryption, please see the following CodeProject answers:
http://www.codeproject.com/search.aspx?doctypeid=5&q=encrypt+connection+string[^].

—SA


这篇关于web.config中的connectionstrins加密中的md5和sha1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆