RSA decryption uses the private exponent on the ciphertext. This lesson checks the original round trip and then repeats it on a second message.

highlighted = computed this step

Why decryption uses the private exponent

Decryption raises the ciphertext to d modulo n. The private exponent was chosen to invert the public exponent on this toy modulus.

m=cdmodnm=c^d\bmod n
Decrypt recovers itThe modular exponentiation ladder is recomputed from exact RSA inputs.Decrypt recovers it - 13^27 mod 55stepbitpriorsquaremultiplyresult0111131311134525220529skip93192688418977

Recover the original message

Ciphertext 13 raised to d=27 modulo 55 returns 7.

1327mod55=713^{27}\bmod{}55=7
Decrypt recovers itThe modular exponentiation ladder is recomputed from exact RSA inputs.Decrypt recovers it - 13^27 mod 55stepbitpriorsquaremultiplyresult0111131311134525220529skip93192688418977

Encrypt a second message

Run the same public operation on message 2 and it becomes ciphertext 8.

23mod55=82^{3}\bmod{}55=8
Second message encryptsThe modular exponentiation ladder is recomputed from exact RSA inputs.Second message encrypts - 2^3 mod 55stepbitpriorsquaremultiplyresult011122112488

Decrypt it again

Using d on ciphertext 8 recovers message 2.

827mod55=28^{27}\bmod{}55=2
Second message decryptsThe modular exponentiation ladder is recomputed from exact RSA inputs.Second message decrypts - 8^27 mod 55stepbitpriorsquaremultiplyresult01118811891717201714skip14311431282841281422

Summary

The private ladder recovers the message: 13 maps back to 7. Exact arithmetic on deliberately tiny toy keys; real RSA uses 2048+ bit primes with padding, and timing/side-channels are not modeled here.

13713\to7
Decrypt recovers itThe modular exponentiation ladder is recomputed from exact RSA inputs.Decrypt recovers it - 13^27 mod 55stepbitpriorsquaremultiplyresult0111131311134525220529skip93192688418977