You will build a toy model of asymmetric encryption with tiny numbers. The public key is and the private key is . The exam does not ask for these sums; the model shows that one key locks and only the other unlocks.
Your tasks.
lock, return m raised to the power key, as the remainder after dividing by N. Python's pow(m, key, N) does this.cipher to the list of the numbers in message, each locked with the public key.all_back to True if unlocking with the private key gives back every number from to after locking with the public key, and False if not.Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…