Does the MD5 algorithm always generate the same output for the same string?

流过昼夜 提交于 2019-12-03 04:32:48

Yes, otherwise MD5 would be useless for things like file verification. What reason would you have for non deterministic output?

Yes, a hash algorithm always produces the same output. If you use the same salt, this will also always produce the same output for a given input.

Yes, MD5 always outputs the same given the same input. That's how it's used for passwords. You store the hash in the database, then when the user types their password in, it's hashed again and the two hashes are compared.

NOTE: MD5 is not recommended for hashing passwords because it's cryptographically weak. There are more suitable cryptographic hashes available, such as bcrypt. However, historically, it has been used for this purpose.

Yes MD5 is deterministic, and this is considered a desirable characteristic for many applications of message digest functions.

As for using a salt, by that you really mean 'changing the input string in some subtle way' don't you ? And, of course, it is also a desirable characteristic of message digests that they produce (with very high probability) a different digest for a different message.

Yes. MD5 is a hash function.

This does not mean that an MD5 is unique. Multiple inputs could map to the same hash, but any given input has only one hash.

Yes. Although in some cases it creates the same hash for different strings.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!