PyCrypto is dead; Use cryptodome #1260

Closed
opened 2025-12-29 16:30:50 +01:00 by adam · 7 comments
Owner

Originally created by @jdell64 on GitHub (Sep 21, 2017).

Issue type

[ ] Feature request
[X] Bug report
[ ] Documentation

Environment

  • Python version: 3.6.2
  • NetBox version: Example: 2.1.3

Description

To replicate, attempt to run this on a windows server / windows box. pcrypto won't install and is dead now. replacing it with pycryptodome gets you further in the process, but fails when referencing XOR

Originally created by @jdell64 on GitHub (Sep 21, 2017). <!-- Before opening a new issue, please search through the existing issues to see if your topic has already been addressed. Note that you may need to remove the "is:open" filter from the search bar to include closed issues. Check the appropriate type for your issue below by placing an x between the brackets. If none of the below apply, please raise your issue for discussion on our mailing list: https://groups.google.com/forum/#!forum/netbox-discuss Please note that issues which do not fall under any of the below categories will be closed. ---> ### Issue type [ ] Feature request <!-- Requesting the implementation of a new feature --> [X] Bug report <!-- Reporting unexpected or erroneous behavior --> [ ] Documentation <!-- Proposing a modification to the documentation --> ### Environment * Python version: 3.6.2 * NetBox version: Example: 2.1.3 <!-- BUG REPORTS must include: * A list of the steps needed to reproduce the bug * A description of the expected behavior * Any relevant error messages (screenshots may also help) FEATURE REQUESTS must include: * A detailed description of the proposed functionality * A use case for the new feature * A rough description of any necessary changes to the database schema * Any relevant third-party libraries which would be needed --> ### Description To replicate, attempt to run this on a windows server / windows box. `pcrypto` won't install and is dead now. replacing it with `pycryptodome` gets you further in the process, but fails when referencing `XOR`
adam added the type: bug label 2025-12-29 16:30:50 +01:00
adam closed this issue 2025-12-29 16:30:50 +01:00
Author
Owner

@jdell64 commented on GitHub (Sep 21, 2017):

Additionally,

https://docs.openstack.org/bandit/latest/blacklists/blacklist_calls.html#b304-b305-ciphers-and-modes

states that Crypto.Cipher.XOR.new is insecure.

@jdell64 commented on GitHub (Sep 21, 2017): Additionally, https://docs.openstack.org/bandit/latest/blacklists/blacklist_calls.html#b304-b305-ciphers-and-modes states that `Crypto.Cipher.XOR.new` is insecure.
Author
Owner

@jdell64 commented on GitHub (Sep 21, 2017):

Opened a PR #1528

I don't know enough about what the XOR function is doing to replace it properly

@jdell64 commented on GitHub (Sep 21, 2017): Opened a PR #1528 I don't know enough about what the XOR function is doing to replace it properly
Author
Owner

@jdell64 commented on GitHub (Sep 22, 2017):

opened a new PR #1531

@jdell64 commented on GitHub (Sep 22, 2017): opened a new PR #1531
Author
Owner

@jeremystretch commented on GitHub (Sep 22, 2017):

Was this issue opened to address a bug? If so, please file a bug report using the issue template. Otherwise, these changes do not appear to be necessary.

@jeremystretch commented on GitHub (Sep 22, 2017): Was this issue opened to address a bug? If so, please file a bug report using the [issue template](https://raw.githubusercontent.com/digitalocean/netbox/develop/.github/ISSUE_TEMPLATE.md). Otherwise, these changes do not appear to be necessary.
Author
Owner

@jdell64 commented on GitHub (Sep 22, 2017):

I'll fill out the form. The two issues it addresses is is that

  1. it won't run on windows because pyCrypto will not install on windows. The only way to make this work is to install packages defunct for 3 years and downgrade to a python version that is no longer supported.

  2. pcrypto is dead. The application makes heavy use of some functions in there that have been dropped from it's replacement pycryptodome

@jdell64 commented on GitHub (Sep 22, 2017): I'll fill out the form. The two issues it addresses is is that 1) it won't run on windows because pyCrypto will not install on windows. The only way to make this work is to install packages defunct for 3 years and downgrade to a python version that is no longer supported. 2) pcrypto is dead. The application makes heavy use of some functions in there that have been dropped from it's replacement `pycryptodome`
Author
Owner

@jdell64 commented on GitHub (Sep 22, 2017):

I have a monkey patch that works (passes the cibuild). Should I raise another PR or just let you review it in my fork? (link: https://github.com/jdell64/netbox)

@jdell64 commented on GitHub (Sep 22, 2017): I have a monkey patch that works (passes the cibuild). Should I raise another PR or just let you review it in my fork? (link: https://github.com/jdell64/netbox)
Author
Owner

@jdell64 commented on GitHub (Oct 9, 2017):

Thanks for all your hard work on this 👍

@jdell64 commented on GitHub (Oct 9, 2017): Thanks for all your hard work on this 👍
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#1260