Convert numeric message from RSA ciphertext to alphabetic I have a set of numeric values that are supposed to represent a message encoded via textbook RSA. For example:

60889
37946
13359
61629
35960
13747


I've decrypted these values to find the corresponding messages:

1535
3109
2789
1191
2700
1829


Now I need to convert these values the alphabetic using the rule that each value represents a triplet of alphabetic characters as follows:

DOG -&gt; 3*(262) + 14*26 + 6 = 2398
CAT -&gt; 2*(262) + 0*26 + 19 = 1371
ZZZ -&gt; 25*(262) + 25*26 + 25 = 17575


I'm not sure how to find the alphabetic characters once I have the original numeric message. The only way I could think to do it would be to calculate every possible triplet combination of letters then find the numeric match for each element. But this method seems way overly complicated.

Anyone have a better way to figure this out? I'm writing this all in Java, so a code example would be even better!
The term you are looking for is Modular Arithmetic.

In the case of 1535, if it is indeed a combination of 3 values ranging 0 to 25, you do the following:

1535 mod 26 = 1
(1535 - 1) / 26 = 59
59 mod 26 = 7
(59 - 7) / 26 = 2

The set of values that generated 1535 is 2,7,1 (c,h,b?), which can easily be verified.