I'm making a small password manager for personal use. I was wondering if i could create an encrypted string with a password. this password will be a string or byte. i also looked at the Fernet class from cryptography but I want to be abel to remember the password so that is no option. I also want to decrypt it.
Asked
Active
Viewed 313 times
1 Answers
0
Check out https://pypi.org/project/pycrypto/
Example from the site (which seems to be what you need):
>>> from Crypto.Cipher import AES
>>> obj = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> message = "The answer is no"
>>> ciphertext = obj.encrypt(message)
>>> ciphertext
'\xd6\x83\x8dd!VT\x92\xaa`A\x05\xe0\x9b\x8b\xf1'
>>> obj2 = AES.new('This is a key123', AES.MODE_CBC, 'This is an IV456')
>>> obj2.decrypt(ciphertext)
'The answer is no'
pigeon_the_programmer
- 111
- 6
-
i tried but the pip install didn't work tried installing the things the error message told me but didn't work. – Rik Smits Nov 15 '20 at 14:09
-
Did you try installing the .tar.gz file and installing it from there? https://pypi.org/project/pycrypto/#files – pigeon_the_programmer Nov 15 '20 at 14:12
-
You also might want to check out https://stackoverflow.com/questions/41843266/microsoft-windows-python-3-6-pycrypto-installation-error – pigeon_the_programmer Nov 15 '20 at 14:14