Following of RSA implementation