Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PyCryptodome instead of PyCrypto #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sunnyville01
Copy link

This pull request is motivated by #165 which lets users install PyCryptodome instead of the now inactive PyCrypto package. Since PyCryptodome installs all modules under the same Crypto package that PyCrypto used, all I had to do was change the references and documentation throughout the project. No actual code, including variables and functions had to be changed.

However, what I have used here is a "drop-in replacement" of PyCrypto, which allows us to not make any changes to the code and continue to use the same Crypto package as mentioned earlier. PyCryptodome offers another library independent of the old PyCrypto and can be installed as PyCryptodomex, where all modules are installed under the Cryptodome package.

With this pull request, old users of btcrecover who don't install PyCryptodome will not be affected (at least, immediately), but if we go the other route of using PyCryptodomex and changing the code to use Cryptodome instead of Crypto, then they will be forced to install it in order to use btcrecover.

These are my thoughts on this, would love any suggestions.

@gurnec
Copy link
Owner

gurnec commented Dec 12, 2017

Hi @sunnyville01. First off, thanks so much for taking the time to write all this new documentation up! I would love to merge it and to get away from PyCrypto... but unfortunately PyCrypto remains a lot faster than other easy-to-install alternatives that I've been able to find.

In particular, in my testing PyCrypto makes btcrecover about 3 times faster with "fast" wallets like MultiBit Classic vs. PyCryptodome. Here are is some basic profile testing I did (on a system with AES-NI), PyCrypto is first:
pycrypto


And PyCryptodome next:
pycryptodome

In particular, the time required to create a new decryption object (setting the key and IV) is much slower with PyCyrptodome. It may very well be that PyCyrptodome is faster for decrypting large chunks of data, but btcrecover only decrypts two or three 16-byte blocks per key, so for btcrecover's use case, PyCrypto works a lot better at least for the time being....

@gurnec gurnec mentioned this pull request Dec 12, 2017
@jonathancross
Copy link

Seems this should be closed?

Repository owner deleted a comment from Janechess Sep 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants