import rsautils as ru n = int(input('n: ')) e = int(input('e (make sure it\'s relatively prime to p-1 and q-1): ')) message = input('message:\n') messagenum = 0 messagenum = ru.string2int(message) messageblocks = ru.int2list(messagenum,n,endian="big") def encrypt_block(blk): return (blk ** e) % n encrypted = [encrypt_block(block) for block in messageblocks] print(ru.int2base64(ru.list2int(encrypted,n)))