Input (grade 13): He first turns M into an integer corresponding to: This can be done quickly using the method of exponentiation by squaring.
Output (grade 12): He then computes the ciphertext corresponding to: This can be done quickly using the method of exponentiation by squaring.