Reimplementation of RSA