You have a good point. The problem, though, is that there is no Java library that does multi-precision computation, such as what BigInteger does in the desktop, with acceptable performance. To give you an idea, running native code, a message (basically a 255 byte array) decryption is taking 30 seconds. Even if you write Java to do some of that work, you would still have to write some functionality in native for speed. Which goes back to the original question: What would be the best way to handle this? Any existing function in the VM code that I could call?
I'd love to use Lejos for my encryption/decryption schemme.