Java RSA Padding: no libraries used I'm trying to implement RSA without using any java libraries using the algorithm from wikipedia HERE

So, anyone can clearly see that it is a raw RSA, and can directly be attacked.

The question is how can i include padding to the algorithm because i'm not using Java libraries, so what is the simple algorithm to implement the RSA padding to make it secure against some attacks?

Also, would Padding alone be enough? or there is something else i need to know?

Any help is appreciated.
Thank you.
Do not use raw RSA at all. 

First simple attack starts when (plain ^ public_exponent) &lt; n , i.e. when the message to be encrypted is small. Then there are more sophisticated attacks and forgeries as soon as 1 plain text and the corresponding cipher text are known, or even can be guessed. And then you have to review all possible attacks on RSA for the last 30+ years. No way.

Implement padding pkcs#1 named RSA-OAEP (based on MGF function, a variant of a feistel cipher).