如何在javascript中执行md5加密和解密 [英] how to perform md5 encryption and decryption in javascript

查看:129
本文介绍了如何在javascript中执行md5加密和解密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了很多,但我没有找到确切的答案。帮助会很明显。

I searched a lot but i did not find out the exact answer.Help would be appreciable.

推荐答案

那是因为你做不到。



不是因为它是Javascript,而是因为MD5不是加密算法 - 它是一种散列算法。

主要区别在于加密可以是反过来取回原始输入,哈希不能因为它丢弃信息以形成哈希值 - 否则我们都会发送700MB视频文件作为128位MD5哈希值并在接收器上unhash它们播放压缩的文件。我们没有,因为你做不到。您需要的信息不再可用。
That's because you can't do it.

Not because it's Javascript, but simply because MD5 is not an encryption algorithm - it's a hashing algorithm.
The major difference is that encryption can be reversed to get back the original input, hashing can't because it throws away information in order to form a hash value - otherwise we would all send 700MB video files as 128 bit MD5 hashes and "unhash" them at the receiver to play teh "compressed" file. We don't, because you can't. The information you would need is no longer available.


这篇关于如何在javascript中执行md5加密和解密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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