I am trying to decrypt a message which its ciphertext in Hex A3 BB 05 00. The original plain text is 8 bits and it is encrypted by a 32 bits RSA key.

I have successfully found the public key is $(e=947,n=2671079)$ and the private key is $(d=713604)$.

Then, I try to convert the Hex string to integer 00 05 BB A3 (Little Endian) $=375715$.

Finally, I calculate $C^d \mod n = 375715^{713604} \mod 2671079 = 544824$.

Calculate in python: C**d % n

My problem:

1) what does $544824$ mean? Is it the original plain text or I need to further converting this number?

2) The plain text should be 8 bits, why the result I get is larger than 8 bits?


  • 1
    $\begingroup$ In Python don't use ** % n use pow(c,d,n) this is more effective. $\endgroup$
    – kelalaka
    Nov 9, 2019 at 14:35

1 Answer 1


Your ciphertext is A3 BB 05 00

In RSA, the ciphertext is always larger than the original data. In this case, the keys are 32 bits, which is 4 bytes, and A3 BB 05 00 is four bytes

  • $\begingroup$ How about the plain text I get after the decryption? It will be 4 byte too? $\endgroup$
    – JC234
    Nov 9, 2019 at 14:51
  • $\begingroup$ Can you prove this statement ` the ciphertext is always larger than the original data`. What if my plaintext is $n\hbox{-}1$ $\endgroup$
    – kelalaka
    Nov 9, 2019 at 19:39
  • $\begingroup$ This is wrong. $N$ is an upper bound for both the message and the ciphertext - there is no asymmetry. At least as long as plain RSA is concerned ( and not something like RSA-OAEP. $\endgroup$
    – tylo
    Nov 9, 2019 at 23:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.