是Md5加密对称还是不对称? [英] Is Md5 Encryption Symmetric or Asymmetric?
问题描述
对于我的iPhone应用程序,苹果想知道我的密码加密(md5)是大于64位对称还是大于1024位对称。我没有能够在网上找到它,所以我想知道是否有人知道答案。此外,这是否被认为是适当的密码加密技术,或者我应该使用不同的?
For my iPhone application, Apple wants to know if my password encryption (md5) is greater then 64-bit symmetric or greater then 1024-bit symmetric. I have not been able to find it online, so I am wondering if anyone knows the answer. In addition, is this considered an appropriate encryption technology for passwords, or should I use something different?
感谢任何帮助!
推荐答案
MD5是一个散列函数,因此根据定义它是不可逆的。这不是加密(对称或不对称)的情况,它必须是可逆的才有用。
MD5 is a hashing function, thus by definition it is not reversible. This is not the case for encryption (either symmetric or asymmetric), which has to be reversible to be useful.
更准确地说,散列是单向函数,因为无限数量的输入可以映射到单个输出,因此不可能确定地获得导致给定输出的确切输入。
To be more precise, hashes are one-way functions, in that an infinite number of inputs can map to a single output, thus it is impossible to obtain the exact input, with certainty, that resulted in a given output.
但是,可以找到散列到相同输出的不同输入。这被称为冲突。
However, it may be possible to find a different input that hashes to the same output. This is called a collision.
一般来说,哈希密码而不是存储纯文本(甚至加密)是一个好主意。 (甚至更好,如果使用盐)但是,MD5已知的弱点(和大集合的彩虹表,有助于找到碰撞),因此它是一个好主意,切换到像SHA-1或SHA-2之一
Generally, hashing passwords instead of storing the plain text (even encrypted) is a good idea. (Even better if using a salt) However, MD5 has known weaknesses (and large collections of rainbow tables that aid in finding collisions), thus it would be a good idea to switch to something like SHA-1 or one of the SHA-2 family of hashes.
但是,为了回答你原来的问题,真的没有办法比较MD5或任何类型的加密哈希;他们没有等同物,因为它像比较苹果和橙子。
However, to answer your original question, there is really is no way to compare MD5 or any hash against any type of encryption; they have no equivalents because it's like comparing apples and oranges.
这篇关于是Md5加密对称还是不对称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!