Skip to content

Instantly share code, notes, and snippets.

View mreram's full-sized avatar
🏠
Working from home

Mohammad Reza Eram mreram

🏠
Working from home
  • Austria
View GitHub Profile
def sign_data(private_key_loc, data):
'''
param: private_key_loc Path to your private key
param: package Data to be signed
return: base64 encoded signature
'''
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
from Crypto.Hash import SHA256
from base64 import b64encode, b64decode