public static byte[] ElgamalDecrypt(String key, String base, BigInteger x, BigInteger p) throws Exception {
        BigInteger c = new BigInteger(key, 16);
        BigInteger a = new BigInteger(base, 16);
        //decrypt  m = (c - a^x)(mod p)
        BigInteger m = c.subtract(a.modPow(x, p)).mod(p);
        return Utilities.toBytes(m);
    }