Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@qcorporation
Copy link

Issue Link

A weakness in the MD5 cryptographic hash function can result in a high number of different messages with the same MD5 hash (known as a "collision"). Previous work on MD5 collisions between 2004 and 2007 showed that the use of this hash function can lead to theoretical attack scenarios; however, more recent work has proven that this scenario can be exploited in practice. This exposes any system which relies on the MD5 hashing mechanism to a realistic threat of attack. It should be noted that the SHA-1 algorithm has also been found to exhibit a lack of collision resistance.

MD2, MD4, MD5 are not recommended and a replacement such as SHA-2 (-224, -256, -384, -512) should be considered

Here is a bad example using unsafe MD5:

MessageDigest aBadDigest = MessageDigest.getInstance("MD5");

Which should be replaced with at least a SHA-2 algorithm:

MessageDigest aBetterDigest = MessageDigest.getInstance("SHA-256");

@emessiha emessiha merged commit e2fc651 into master Jun 11, 2021
@emessiha emessiha deleted the master_WEAK_MESSAGE_DIGEST_MD5_1592396687 branch June 11, 2021 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.