simple-crypt
simple-crypt copied to clipboard
Replace PyCrypto with PyCryptoDome
This PR replaces the pyCrypto
dependency with the actively maintained (and backward compatible) pyCryptoDome
. See discussion on EOL for PyCrypto
- Fixes #17
- FIxes #20
- Fixes #21
- Fixes #27
- Fixes #28
- Alternative to PR #22 and #24
- The fork for PR #22 appears to be deleted and can't be merged
- I didn't see #24 before creating this PR, but this PR goes a little farther and updates documentation, etc.
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!
Doesn't seem to work on 3.9. ModuleNotFoundError: No module named 'Crypto'
.
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)
@KyleKing I'm dumb. Had the extra stuff installed. Thanks. Good stuff.
@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
This PR is still ready for review/merge/release if there is any interest!