High severityPHPCryptographyMEDIUM confidence
Weak Cipher DES ECB
Use of a weak cipher (DES/3DES/RC4) or ECB mode (CWE-327/CWE-326).
Standards mapping
- OWASP Top 10
- A02:2021 - Cryptographic Failures
- OWASP ASVS
- V6.2.2 (L2)
Vulnerable vs. safe
Flagged by this check
return openssl_encrypt($data, "des-ecb", $key);Passes - the safe pattern
return openssl_encrypt($data, "aes-256-gcm", $key, OPENSSL_RAW_DATA, $iv, $tag);Why it matters & how to fix it
Use of a weak cipher (DES/3DES/RC4) or ECB mode (CWE-327/CWE-326). ECB reveals plaintext patterns and DES/RC4 are broken. The deprecated mcrypt extension should not be used at all. Use openssl_encrypt with 'aes-256-gcm' (authenticated) and a random IV/nonce.
References
Rule ID integsec-php-weak-cipher-des-ecb - engine: Opengrep - license: MIT - Copyright (c) IntegSec Inc.
TurboPentest runs this check automatically
Connect a GitHub repo and this check runs on every white-box pentest - AI-validated and reported with proof, from $99 per target.
Start a pentestRelated checks
- JavaScript / TypeScript - CryptographyInsecure Randomness For Secrets
- JavaScript / TypeScript - CryptographyWeak Cipher Algorithm
- JavaScript / TypeScript - CryptographyWeak Hash Algorithm
- Python - CryptographyInsecure Random Token
- Python - CryptographyWeak Cipher DES ECB
- Python - CryptographyWeak Hash MD5 SHA1