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

Replace PyCrypto with PyCryptoDome #26

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

KyleKing
Copy link

@KyleKing KyleKing commented Apr 15, 2020

This PR replaces the pyCrypto dependency with the actively maintained (and backward compatible) pyCryptoDome. See discussion on EOL for PyCrypto

All tests pass; however, I had to skip a test that called a feature of pyCrypto (ctr()) that was changed in pyCryptoDome. If this PR will be merged, I can spend some time to figure out how to re-implement that test

❯ nosetests -x
.....................
----------------------------------------------------------------------
Ran 21 tests in 437.129s

OK

Update: I'll keep my fork live and will accept PRs. You can install the package from my fork with:

pip install git+https://github.com/KyleKing/simple-crypt.git

I've been using the fork for almost a year in Python 3.9 and 3.6 with backward compatibility with the official simple-crypt 4.1.7 in a Python 2.7 project without issue. Hopefully, these changes can be merged and released so others can benefit!

@zmarffy
Copy link

zmarffy commented Jan 24, 2021

Doesn't seem to work on 3.9. ModuleNotFoundError: No module named 'Crypto'.

@KyleKing
Copy link
Author

KyleKing commented Jan 24, 2021

Can you check that crypto and pycrypto are uninstalled? If not, can you send me the full stack trace? I tested locally in a new venv with Python 3.9.0 on Mac and was able to run the below script

# check_imports.py
from simplecrypt import encrypt, decrypt

password = 'pass'
ciphertext = encrypt(password, 'my secret message')
plaintext = decrypt(password, ciphertext)
print(ciphertext, plaintext)

@zmarffy
Copy link

zmarffy commented Jan 28, 2021

@KyleKing I'm dumb. Had the extra stuff installed. Thanks. Good stuff.

@KyleKing
Copy link
Author

KyleKing commented Feb 12, 2021

@andrewcooke can you please take a look and consider merging this change?

I need to use simple-crypt in a project with Python ^3.8 that is backward compatible with files encrypted with simple-crypt 4.1.7

@KyleKing
Copy link
Author

KyleKing commented Dec 20, 2023

This PR is still ready for review/merge/release if there is any interest!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants