Unfortunatetly, I cannot use any of the standard security packages / classes that are available, but I have to create it from scratch
Erm, are you telling us that you are not allowed to use JCE to perform this task. In effect you have to a) Implement your own JCE-alike layaer, and b) implement a pure
java version of the RSA algorithm so that you can encrypt using public and private keys?
Using the "Standard way"
But, I imagine you knew that already.