# How to break up plaintext for RSA?

Given a plaintext of length 20 over the latin alphabet {A, B, . . . , Z} and the RSA key (n, e) with n = 77. Find a way to break up the plaintext in as little as possible blocks of information, each of which can be encrypted by the RSA algorithm using the given key.

My question is,

1. What are the possibilities for a plaintext (length 20). Is it $$26^{20}$$ or $$26\ nPr\ 20$$?

I think, since we have 26 characters we are in the sense writing as 20 characters, then a permutation should be what is needed since we essentially write all possible ways 26 length can be 'expressed' into 20 length (permuting).

1. What is a way to break it up? Taking $$log_{77}{P}$$ seems like a way. Is there any other way? Even with $$log_{77}{P}$$, how do I actually proceed to encrypting?

2. RSA Enc is a deterministic algorithm, so encrypting each letter(this is because $$n$$ has two digits and blocks are constructed by 2 digits ea) gives the same output, hence, a dictionary of each letter with its encryption (26 in total)
• The answer to 2 is off track. As suggested in the question, we can break the plaintext into $\left\lceil\,\log_{77}(26^{20})\right\rceil$ RSA cryptograms. This is of course very insecure, for several reasons: $n$ is so small; and independently, anyone with the public key can verify a guess of the plaintext. Hint: consider the plaintext as an integer originally in base 26 when expressed as letters, and re-encoded in base 77 for encryption.
• As fgrieu has indicated, you can do this base conversion yourself by multiplying with 26 and then adding the index of the character in the alphabet to the (big) integer - doing this 20 times. The resulting value can be put into base 77 by using divide with remainder (usually a single operation in bigint libraries), doing this $\big\lceil\log_{77}(26) \cdot 20\big\rceil$ times. The reverse is -uh- the reverse of this. Aug 2 at 8:57