MD5哈希加密和解密 [英] MD5 hash encrypt and decryption

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

问题描述



i这个编码解码stufs是新的,我有一些问题。

我在VS 2012 ASP.NET c#上工作。

我的问题是我需要从某个输入字符串创建CheckSum值。 CheckSum的长度需要为16字节(32个字符)长,如下所示:8A303F3E0CB4F8A9CDA5AC120F9B90A4。

加密需要使用密钥完成,例如TEST_PASS,将使用此密钥后者要解密这个哈希值....

希望你理解我的要求和我需要的东西请帮助我

解决方案

否! MD5是加密的东西,但它不用于加密或解密。这是加密哈希函数

http://en.wikipedia。 org / wiki / Cryptographic_hash_function [ ^ ]。



因此,它并不好;强烈建议不要将它用于任何加密目的:它已被破坏。请参阅: http://en.wikipedia.org/wiki/Md5 [ ^ ]。



那就是它。但是校验和可以用于非加密目的,但仅作为检查。这是你可能需要的。因此,您需要的一切都在.NET FCL中提供:

http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.aspx [ ^ ]。



-SA

Hi,
i am new in this encoding decoding stufs and i have some problem.
I work on VS 2012 ASP.NET c#.
My problem is that i need to create CheckSum value from some input string. The length of the CheckSum need to be 16 bytes (32 characters) long like this one: "8A303F3E0CB4F8A9CDA5AC120F9B90A4".
The encryption need to be done using a pass key for example TEST_PASS and this key will be used latter to be decrypted this hash value....
hope you understand what i ask and what i need pls help me

解决方案

No! MD5 is cryptography thing, but its not for encryption or decryption. This is a cryptographic hash function:
http://en.wikipedia.org/wiki/Cryptographic_hash_function[^].

And as such, it is not good; it''s strongly recommended not to use it for any cryptographic purposes: it''s broken. Please see: http://en.wikipedia.org/wiki/Md5[^].

That''s it. But check sum can be used for non-cryptographic purposes, but just as a check. This is what you probably need. So, everything you need is provided in .NET FCL:
http://msdn.microsoft.com/en-us/library/system.security.cryptography.hashalgorithm.aspx[^].

—SA


这篇关于MD5哈希加密和解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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