Skip to content

Instantly share code, notes, and snippets.

@Manouchehri
Manouchehri / rfc3161.txt
Last active April 6, 2024 16:22
List of free rfc3161 servers.
https://rfc3161.ai.moda
https://rfc3161.ai.moda/adobe
https://rfc3161.ai.moda/microsoft
https://rfc3161.ai.moda/apple
https://rfc3161.ai.moda/any
http://rfc3161.ai.moda
http://timestamp.digicert.com
http://timestamp.globalsign.com/tsa/r6advanced1
http://rfc3161timestamp.globalsign.com/advanced
http://timestamp.sectigo.com
def encrypt_RSA(public_key_loc, message):
'''
param: public_key_loc Path to public key
param: message String to be encrypted
return base64 encoded encrypted string
'''
from M2Crypto import RSA, BIO
key = open(public_key_loc, "r").read()
pubkey = str(key).encode('utf8')
bio = BIO.MemoryBuffer(pubkey)