cwe-327-weak-cryptography

Replace weak cryptographic algorithms with secure alternatives in Java code.

3|1|Updated Mar 6, 2026
One-click install
npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-327-weak-cryptography
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: cwe-327-weak-cryptography
Source: https://github.com/DevelopersCoffee/java-cwe-security-skills/tree/main/cwe-327-weak-cryptography
Command: npx skills add https://github.com/DevelopersCoffee/java-cwe-security-skills --skill cwe-327-weak-cryptography

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses vulnerabilities arising from the use of weak or outdated cryptographic algorithms in Java applications, ensuring stronger security practices.

Core Features & Use Cases

  • Vulnerability Remediation: Identifies and provides secure alternatives for broken or risky cryptographic algorithms like MD5, SHA-1, DES, and ECB mode.
  • Secure Hashing & Encryption: Guides developers to implement robust hashing (SHA-256, SHA-3, bcrypt, scrypt, Argon2) and encryption (AES-256 with GCM or CBC mode).
  • Use Case: When a SAST tool flags the use of MD5 for password hashing, this Skill can be invoked to refactor the code to use bcrypt for secure password storage.

Quick Start

Use the cwe-327-weak-cryptography skill to replace the use of MD5 with SHA-256 for hashing in the provided Java code.

Frequently Asked Questions about cwe-327-weak-cryptography

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix CWE-327 weak cryptography vulnerabilities flagged by SAST in Java?

Fix CWE-327 vulnerabilities by replacing weak algorithms like MD5, SHA-1, and DES with secure alternatives such as SHA-256, AES-256, and bcrypt for hashing and encryption.

What are the secure alternatives to MD5 and SHA-1 for password hashing in Java?

Secure alternatives to MD5 and SHA-1 for password hashing in Java include robust functions like bcrypt, scrypt, Argon2, and SHA-256 to guarantee strong password storage.

How do I replace DES and ECB mode encryption with secure Java crypto algorithms?

Replace DES and ECB mode encryption with secure Java crypto algorithms by implementing AES-256 using authenticated encryption modes like GCM or CBC.

What is CWE-327 and when do I need to remediate broken cryptographic algorithms?

CWE-327 is the use of broken or risky cryptographic algorithms, requiring remediation when SAST tools flag outdated hashing like MD5 or weak encryption like DES in Java applications.

Can I use this to refactor Java code flagged for RC4 encryption vulnerabilities?

Yes, you can refactor Java code flagged for RC4 encryption vulnerabilities by replacing the outdated algorithm with modern, robust cryptographic standards like AES-256.