Weak cryptographic algorithms

Weak cryptographic algorithms

Description

MD5 and SHA-1 lack the collision resistance needed for signatures and file verification. Avoid DES and RC4 for new encrypted data.

Potential impact

Hash collisions can hide changes, weak ciphers can expose plaintext, and fast hashes make stored passwords easier to guess.

Remediation

For file verification, compare a hash such as SHA-256 with a trusted reference. Use vetted authenticated encryption (AEAD) for data and a salted password hash such as Argon2id, bcrypt or PBKDF2 with an appropriate cost for passwords.

Examples

Before

c
unsigned char out[MD5_DIGEST_LENGTH];
MD5(data, len, out);

After

c
unsigned char out[SHA256_DIGEST_LENGTH];
SHA256(data, len, out);

SHA256 writes the 32-byte digest of data to out.

References