Your code is just an implementation of textbook RSA. Without proper padding, RSA is insecure. Just making you aware!