python-rsa
python-rsa copied to clipboard
Support for PKCS1_v1_5
I can use
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
public_key = RSA.importKey(api_key)
cipher = PKCS1_v1_5.new(public_key)
encrypted = base64.b64encode(cipher.encrypt(hashed))
Is there a way to encrypt using your library?
I need python analog of ruby code
> Calculating your outgoing signature:
api_key = <Your API key>
public_key = OpenSSL::PKey::RSA.new(Base64.decode64(api_key))
public_key.public_encrypt(hash_signature)
> Calculating an incoming signature:
api_key = <Your API key>
OpenSSL::PKey::RSA.new(Base64.decode64(api_key)).public_decrypt(Base64.decode64(encrypted))