def encrypt(public_key, message):
    """
    Takes a non-negative integer message encrypts it using the public key
    """
    if message >= public_key["n"]:
        raise ValueError("Message is too long. Consider generating larger keys.")
    return pow(message, public_key["e"], public_key["n"])