I have a ciphertext c_t
and a RSA public key pair (e, n)
. I also know that the encrypted message is a three-letter word in the following manner ... (a-z, a-z, a-z). Now I want to decrypt this ciphertext.
My thoughts are the following: I want to use bruteforce for decryption like this ...
if(c_t && c = (aaa)^e mod n)
if(c_t && c = (baa)^e mod n)
if(c_t && c = (caa)^e mod n)
//...
if(c_t && c = (zzz)^e mod n)
{
//match: decrypted
}
My next idea is, that I use 3 loops (i, j, k) for this iterative process to check all possible combinations.
But I am not sure if there is a better way to decrypt such a tree-letter word.