Implementation of RSA, both textbook and padded