Sir, I have the jquery solution to encryption on the client side but it create "MD5" only.
先生,我有客户端加密的jquery解决方案,但它只创建“MD5”。
I want Salted Md5 Encryption on the Clientside and Decrypt it at the Server Side in Asp.net 4.0 and C#
我想在客户端上使用Salted Md5加密并在Asp.net 4.0和C#中在服务器端解密它
My Code for encryption are as follows:
我的加密代码如下:
<script type="text/javascript">
function chn() {
var a = document.getElementById('txt1');
var b = document.getElementById('txt2');
var c = a.value; var d = $.md5(c);
b.value = (d);
}
</script>
I want that encryption must be change on every attempt..
我希望每次尝试都必须更改加密。
Example : first time encryption of abc is xyz
示例:abc的第一次加密是xyz
and again if I will try with that name "Abc" then it should create another Encryption and check on server Side.
再次,如果我将尝试使用该名称“Abc”,那么它应该创建另一个加密并检查服务器端。
Please Help me out
请帮帮我
2 个解决方案
#1
5
MD5 is a hash, not an encryption mechanism. Hashes are by their very nature lossy, and multiple inputs can (and by virtue of the pigeonhole principle absolutely will) produce the same outputs.
MD5是哈希,而不是加密机制。哈希本质上是有损的,多个输入可以(并且凭借鸽笼原则绝对会产生)相同的输出。
Running MD5 works like counting the number of vowels in a word. If I tell you that a word has 4 vowels in it, and ask you to tell me what the original word was, you simply don't have enough information to give me the the correct answer. You may be able to find some word that has 4 vowels in it, but you won't know whether the word you found was my word. Maybe it is, maybe it isn't. It's mathematically impossible for you to tell.
运行MD5就像计算单词中元音的数量一样。如果我告诉你一个单词中有4个元音,并且要求你告诉我原来的单词是什么,那么你根本没有足够的信息来给我正确的答案。你或许可以找到一些有4个元音的单词,但你不会知道你找到的单词是否是我的单词。也许是,也许不是。在数学上你不可能告诉你。
MD5 works the same way. You're throwing away tons of information, possible gigabytes or terabytes of information, and producing instead a single 16-byte summary.
MD5的工作方式相同。您丢弃了大量信息,可能是千兆字节或太字节的信息,而是生成一个16字节的摘要。
It is, by intention, an inherently one-way process.
根据意图,这是一种固有的单向过程。
#2
0
MD5 cant be decrypted. It is a one way hash. Beside I find that anything that could be decrypted on the other end is insecure, in the case it is intercepted. Always design and code to ensure that you can validate a salt and not decrypt it :)
MD5无法解密。这是一种单向哈希。除此之外,我发现任何可以在另一端解密的东西都是不安全的,如果它被截获的话。始终设计和编码,以确保您可以验证盐,而不是解密它:)
#1
5
MD5 is a hash, not an encryption mechanism. Hashes are by their very nature lossy, and multiple inputs can (and by virtue of the pigeonhole principle absolutely will) produce the same outputs.
MD5是哈希,而不是加密机制。哈希本质上是有损的,多个输入可以(并且凭借鸽笼原则绝对会产生)相同的输出。
Running MD5 works like counting the number of vowels in a word. If I tell you that a word has 4 vowels in it, and ask you to tell me what the original word was, you simply don't have enough information to give me the the correct answer. You may be able to find some word that has 4 vowels in it, but you won't know whether the word you found was my word. Maybe it is, maybe it isn't. It's mathematically impossible for you to tell.
运行MD5就像计算单词中元音的数量一样。如果我告诉你一个单词中有4个元音,并且要求你告诉我原来的单词是什么,那么你根本没有足够的信息来给我正确的答案。你或许可以找到一些有4个元音的单词,但你不会知道你找到的单词是否是我的单词。也许是,也许不是。在数学上你不可能告诉你。
MD5 works the same way. You're throwing away tons of information, possible gigabytes or terabytes of information, and producing instead a single 16-byte summary.
MD5的工作方式相同。您丢弃了大量信息,可能是千兆字节或太字节的信息,而是生成一个16字节的摘要。
It is, by intention, an inherently one-way process.
根据意图,这是一种固有的单向过程。
#2
0
MD5 cant be decrypted. It is a one way hash. Beside I find that anything that could be decrypted on the other end is insecure, in the case it is intercepted. Always design and code to ensure that you can validate a salt and not decrypt it :)
MD5无法解密。这是一种单向哈希。除此之外,我发现任何可以在另一端解密的东西都是不安全的,如果它被截获的话。始终设计和编码,以确保您可以验证盐,而不是解密它:)