java.security — weak hash
Reversible One Way Hash in java.security Package
The Java MessageDigest class provides a number of options for algorithms
to hash data. However, some of the hash algorithms are insecure and should
not be used. These insecure hash algorithms include MD5 and SHA-1.
The MD5 hash algorithm is a cryptographic hash function that was designed in the early 1990s. MD5 is no longer considered secure, and passwords hashed with MD5 can be easily cracked by attackers.
The SHA-1 hash algorithm is also a cryptographic hash function that was designed in the early 1990s. SHA-1 is no longer considered secure, and passwords hashed with SHA-1 can be easily cracked by attackers.
Example
| MessageDigestMD5.java | |
|---|---|
Example Output
Remediation
The recommendation is to swap the insecure hashing method to one of the more
secure alternatives, SHA-256 or SHA-512.
| MessageDigestMD5.java | |
|---|---|
Default Configuration
See also
New in version 0.5.0