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 -> 3*(262) + 14*26 + 6 = 2398 CAT -> 2*(262) + 0*26 + 19 = 1371 ZZZ -> 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!