Implementing several attacks on plain ElGamal encryption