some useful functions for ElGamal encryption in python