def rsa(text, pubkey, modulus): text = text[::-1] rs = pow(int(binascii.hexlify(text), 16), int(pubkey, 16), int(modulus, 16)) return format(rs, 'x').zfill(256)
def rsa(self, text, pubkey, modules): text = text[::-1] rs = pow(int(binascii.hexlify(text), 16), int(pubkey, 16), int(modules, 16)) return format(rs, "x").zfill(256)
def rsa_encrypt(text, pub_key, modulus): text = text[::-1] # rs = int(codecs.encode(text.encode('utf-8'), 'hex_codec'), 16)**int(pub_key, 16) % int(modulus, 16) rs = pow(int(binascii.hexlify(text), 16), int(pub_key, 16), int(modulus, 16)) return format(rs, 'x').zfill(256)