I have been slightly over-ambitious with my first project and need a little bit of help if that's ok. I need to convert the returnChar function to be able to return a string of values; at the moment it works on individual characters. It is the deciphering process of an RSA encryption and works perfectly when enciphering and deciphering one letter at a time, this is very frustrating as I just can't do it, I have managed for the encryption portion! Thanks for any help in advance, sorry about the trivial question.
**Only the returnChar function is the problem, but I'm including all of my code in case anyone is curious**
(P.S p and q are tiny just to make testing easy I know that it's not secure at this size)
unsigned long long is just going to cause problems. Especially on 32-bit machines. Consider something smaller.
Since you can encrypt one at a time, then in theory your code is sound. If you're having trouble with larger amounts you're probably running out of something.
the u1, u2, v portion is the extended Euclidean algorithm so using "algebraic" terms made it A LOT easier, I didn't plan on sharing it and so I take on board that changing it in future would be wise. The code is fine except for the returnChar function, at the moment it can produce "a", "b", "m" etc but I can't work out how to make it able to produce "ab", "words" etc I can only output single letters. I am using long long unsigned as before I had this problem it was working with 1024bit numbers, which require unsigned long long int.