I've been trying to encrypt data in Python with RSA in pycrypto. I've tried to follow the instructions here: http://www.laurentluce.com/posts/python-and-cryptography-with-pycrypto/ but here's what comes out when I call enc_data = public_key.encrypt('abcdefgh', 32):
Traceback (most recent call last): File "<pyshell#5>", line 1, in <module> enc_data = public_key.encrypt('abcdefgh', 32) File "C:\Python35\lib\site-packages\Crypto\PublicKey\RSA.py", line 150, in encrypt return pubkey.pubkey.encrypt(self, plaintext, K) File "C:\Python35\lib\site-packages\Crypto\PublicKey\pubkey.py", line 75, in encrypt ciphertext=self._encrypt(plaintext, K) File "C:\Python35\lib\site-packages\Crypto\PublicKey\RSA.py", line 224, in _encrypt return (self.key._encrypt(c),) File "C:\Python35\lib\site-packages\Crypto\PublicKey\_slowmath.py", line 65, in _encrypt return pow(m, self.e, self.n) TypeError: unsupported operand type(s) for pow(): 'str', 'int', 'int' Thanks in advance for any advice regarding this issue.
Crypto.Cipher.PKCS1_OAEP.