I have the following data where all the inputs are Big Integers,
- group size $p$,
- group generator $g$
- public key of the receiver $y$
- $c_1$ and $c_2$
- Random Number as well
I am trying to execute an EL Gamal Attack (On a Weak Number Generator) without knowing the secret key $x$.
$$y = g^x \bmod p\quad \text{where } x \text{ is the secret key.}$$
As we know $y,g$ and $p$. I am trying to compute $x$.I tried as follows $m$ as,
$$m = c_2 \times (c_1^x )^{-1}$$
By converting $m$ as ByteArray, I am not getting the desired output!
- What I am missing out? What's the advantage of having this random number as input?
Actually,I tried finding x by taking log on both sides,
log y = x log g mod p
Each y, g, and P are of 1024 bits. Java is not supporting this BigInteger
computation. How can I solve this equation involving such a big number?
Or is there any other shortcut available to compute the secret key, if the public key and g are given? Also, how can I take advantage of the given random number?
BigInteger
there :) $\endgroup$