Skip to content

Instantly share code, notes, and snippets.

Manouchehri / rfc3161.txt
Last active May 23, 2022
List of free rfc3161 servers.
View rfc3161.txt
View Python M2Crypto: Encrypt Message
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)