Examples of Decrypting with RSA
We have already looked at how to encrypt plaintext P given the public information [n, e] into ciphertext C. We are now going to look at some examples of decrypting C back into plaintext given the decryption key d. We note the following congruence holds:
(1)Example 1
Given the public information [n, e] = [143, 11] and the decryption key d = 11, decrypt the ciphertext C = 106.
We know that $P \equiv C^d \pmod {n}$, or more appropriately, $P \equiv 106^{11} \pmod {143}$. We note that we don't even need the encryption key e in these scenarios. We will now evaluate this congruence as follows:
(2)Hence our plaintext P = 7. We note this to be true since we have already encrypted P = 7 on a previous example for encryption. Hence when decrypting C, we get P back as a result.
Example 2
Given the public information [n, e] = [391, 13] and that the decryption key d = 325, decrypt the ciphertext C = 213.
By the congruence, we know that $P \equiv 213^{325} \pmod {391}$. We will now evaluate this congruence as follows:
(3)Hence our plaintext P = 127.