data = 'testing 123'
encrypted = key.public_encrypt(data, m2c.RSA.pkcs1_padding)
print('Encrypted data:')
print('\n'.join(textwrap.wrap(' '.join([('%02x' % ord(b)) for b in encrypted]))
    ))
decrypted = key.private_decrypt(encrypted, m2c.RSA.pkcs1_padding)
print('Decrypted data:')
print(decrypted)
print(data == decrypted)
Python RSA Decryption Using OpenSSL Generated Keys