cleanup RSA encryption code