def enc(pub, plaintext):
    e, m = pub
    plain = Bn.from_binary(plaintext)
    assert 1 < plain < m
    cipher = pow(plain, e, m)
    return cipher.binary()
Naive RSA encryption
dataset/ETHPy150Open gdanezis/petlib/examples/toyrsa.py/enc