Breaking ElGammal by solving discrete logarithm in subgroups with Sage

570 Views Asked by At

I'm working in the context of ElGamal encryption problem as describe in the second image of this post. In my problem, I work on $\mathbb{Z}_p^*$ with p prime. I'm told that I should look for subgroups of index two so that the discrete logarithm problem becomes easier. I'm working with sage.

  1. How can I look for the subgroup of index 2 in $\mathbb{Z}_p^*$ with sage?
  2. Once I find the subgroup of index 2 how would I solve the discrete logarithm problem on it? How would I use this result for solve the discrete logarithm problem in the whole group?