0
$\begingroup$

Given the letter-number cipher: a=00, b=01, c=02, etc., encrypt the word 'hi' and decrypt its ciphertext using RSA. The public key is (5,35) and the private key is (29,35).

I know that 'hi' is represented numerically as 0708, and encrypting it using (0708^5)mod35 gives 8 as the answer. My instructor then said that I have to pad the result with 3 leading zeroes to get a four digit value (0008) which represents the ciphertext 'ai'.

I find it hard to decrypt it, as (0008^29)mod35 gives 8 as the answer, and I don't see how I can manipulate this result to get a value that gives me the original plaintext.

Can you please point out where I went wrong or what I'm failing to understand?

$\endgroup$
  • 3
    $\begingroup$ The modulus is shorter than the plaintext (35<708), it'd be a miracle if it's lossless! $\endgroup$ – DannyNiu Apr 5 at 3:21
  • 1
    $\begingroup$ Yeah, I think you need to encrypt / decrypt each letter separately. $\endgroup$ – Maarten Bodewes Apr 5 at 3:32
  • $\begingroup$ @DannyNiu thanks for the tips! $\endgroup$ – bones Apr 7 at 9:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.