Consider removing PyCryptodome from blacklist
See original GitHub issueAs the maintainer of PyCryptodome, I have reservations on the library being blacklisted (B414).
Can you help me understand why you think it “has not fully addressed the issues inherent in PyCrypto”?
It shares none of the bugs, and it broke API compatibility with it by dropping the most dangerous ones (such as having ECB as the default cipher mode).
You can certainly shoot yourself in the foot with the low-level primitives, but the same can be achieved with cryptography (which is a great project, no doubts about it).
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:9 (4 by maintainers)
Top Results From Across the Web
blacklist_imports — Bandit documentation - Read the Docs
This import blacklist has been removed. The information here has been left for historical purposes. pycryptodome is a direct fork of pycrypto that...
Read more >Bandit Documentation - Read the Docs
This import blacklist has been removed. The information here has been left for historical purposes. pycryptodome is a direct fork of pycrypto ...
Read more >blacklist href in python to remove junk sites - Stack Overflow
I want it to print every site that isnt blacklisted(how the code looks so far) but it doesnt work if you change the...
Read more >Wno-unused-result in _sysconfigdata__darwin_darwin.py ...
I think the question might be how could py3x-cchardet be using the ancient gcc-4.2 and let's fix ... Port: python39 py-pycryptodome added; python36...
Read more >SUSE Manager Server 4.0
susemanager-doc-indexes: Added new section for bootstrap repository for end of life products in Client Configuration Guide. Remove old certs ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Old algorithms are still useful to access, verify and/or import old data (which would be lost otherwise) or interface with old system (say, not so recent embedded hardware).
So, even though I would also like to see only the latest and greatest algorithms being used, I find that approach only works in environments where code updates are cheap and data somewhat volatile (like web services, etc).
Additionally, the threat of people selecting outdated algorithms is probably one order of magnitude less serious than incorrect key generation and management (like using fixed keys and passwords, using bad RNG, storing keys in the clear or not wiping them) or unsafe compositions of otherwise safe algorithms, which are unfortunately more difficult to detect.
All in all, I think it would be more fair for
banditto blacklist individual modules inpycryptodomeyou feel strongly against (likeCrypto.Cipher.DES), as opposed to entire packages. I also just noticed thatcryptographytoo gives you access to weak algorithms (ECB mode, RSAES-PKCS1-v1_5, MD5, SHA1, TDES, etc) butbanditdoes not warn the user in that case, so that is certainly not showing consistency.+1. I don’t see why you would blacklist the entire module vs specific unsafe methods and algorithms. Pycryptodome is vastly improved compared to pycrypto, and is an easy transition for systems using pycrypto. Most encryption libraries have some form of support for legacy algorithms, which is just part of the reality of supporting older or legacy systems (as well as migrations from them). It’s definitely worth flagging insecure function usage, but flagging the entire library is an unnecessarily nuclear approach.
EDIT: Also, as related but different isuse, pycryptodome triggers the pycrypto alert when using the
Cryptoimports (which makes sense)