Skip to content

Use of Broken or Risky Cryptographic Algorithm

Description

The Blowfish encryption algorithm is considered insecure for encrypting files over 4GB in size and should be replaced with more secure alternatives like ChaCha20Poly1305 or AES-GCM.

Examples

Insecure Code

python
Cryptodome.Cipher.Blowfish.new(...) or Crypto.Cipher.Blowfish.new(...)

Secure Code

python
ChaCha20Poly1305 from cryptography.hazmat.primitives.ciphers.aead or AESGCM from cryptography.hazmat.primitives.ciphers.aead

Remediation

Replace Blowfish with ChaCha20Poly1305 or AES-GCM from the cryptography package.

Rule Details

FieldValue
IDCODE-0115
CategoryCrypto
SeverityMEDIUM
CWECWE-327
ConfidenceHIGH
ImpactMEDIUM
LikelihoodMEDIUM
ExploitabilityMODERATE
Tagsencryption, Blowfish
OWASPA3:2017-Sensitive Data Exposure, A02:2021-Cryptographic Failures