python-rsa icon indicating copy to clipboard operation
python-rsa copied to clipboard

Support for PKCS1_v1_5

Open lud4ik opened this issue 6 years ago • 0 comments

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))

lud4ik avatar Oct 31 '19 00:10 lud4ik