encrypt/decrypt working, but seems to be a problem with Miller-Rabin test