msg = [(c ** d % n) for c in cipher]
msg = [chr(m) for m in msg]
message = ''.join(msg)
return message

def enc(message, pubkey):
    session_key = random.randrange(1, 256)
return asymmetric_enc(session_key, pubkey), symmetric_enc(message, session_key)

def dec(message, prikey):
    session_key, body = message
session_key = asymmetric_dec(session_key, prikey)
return symmetric_dec(body, session_key)
Add randomness to a simple RSA encryption example