I know that rsa normally is made to make it with big integers, but i trying to make the algorithm myself (with the help of wikipedia) and I´m making it with small numbers to track the problems easily.
The problem is that sometimes the decryption of the crypted message is wrong!
Exactly when I choose
q=5, the rest goes like this:
n=55 euler(n)=40 = (p-1)(q-1) e=13 d=37
the crypted message (using message=65) is:
and using the chinese reminder theorem (wikipedia´s advise):
Dp=7 Dq=1 Qinv=9 m1=10 m2=0 h=2
and the decrypted message is:
It´s a problem of the choosen prime numbers? I think that the rest I made it fine, I also check it with rsa calculator: https://www.cs.drexel.edu/~jpopyack/IntroCS/HW/RSAWorksheet.html
I know also that to choose d and e there are more options, but the choosen ones they would be fine too. Maybe there is some other condition that is not in the wikipedia?