Weak encryption algorithm (DES) used for password detected.
- Rule ID: java_lang_weak_password_encryption_des
- Languages: java
- Source: weak_password_encryption_des.yml
According to OWASP, DES (Data Encryption Standard) is considered a weak encryption algorithm and therefore shouldn't be used.
Moreover, since encryption is reversible, it is possible to retrieve the plaintext value. This makes encryption a bad choice for passwords. Instead, passwords should be hashed.
❌ Do not use encryption for passwords, wherever possible.
✅ Use a recommended hashing library for passwords
MessageDigest md = MessageDigest.getInstance("SHA-256");
- CWE-326: Inadequate Encryption Strength
- CWE-327: Use of a Broken or Risky Cryptographic Algorithm
- CWE-916: Use of Password Hash With Insufficient Computational Effort
OWASP Top 10
To skip this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --skip-rule=java_lang_weak_password_encryption_des
To run only this rule during a scan, use the following flag
bearer scan /path/to/your-project/ --only-rule=java_lang_weak_password_encryption_des
Ready to take the next step? Learn more about Bearer Cloud.