Usage of weak encryption algorithm (RC4)

Description

Your code is at risk due to the use of RC4 (Rivest's Cipher version 4), a weak encryption algorithm. This vulnerability can lead to data breaches and compromises your security measures.

Remediations

  • Do not use RC4 as it is outdated and vulnerable to attacks. Its use can significantly weaken your application's security.
  • Do use stronger encryption algorithms to enhance data security. AES (Advanced Encryption Standard) is a recommended choice.
    from Crypto.Cipher import AES

    cipher = AES.new(aes_key, AES.MODE_OCB)
    ciphertext, tag = cipher.encrypt_and_digest(plaintext)

References

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=python_lang_weak_encryption_rc4

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=python_lang_weak_encryption_rc4