Tags: elgamal
Rating:
# Challenge : C is G ?Ez Camel

connecting the the server and we receive :

Refering to the title and server message its [ElGamal Encryption](https://en.wikipedia.org/wiki/ElGamal_encryption) . Taking a look for encryption option :

so we can give a message and a random number , that's interesting ! i will tell you why in a moment , lets see first get the cure option :

So we need the private key to get the cure , but how ? we don't have public keys , no g no y no p nothing ...
Back to the interesting thing , the encryption options allows us to give a message and a random
since :
**c1=pow(g,r,p) and c2=M*pow(y,r)[p]**
we send r=1 and M=1 , it gives us : **c1=g and c2=y**
we send r=1 and M=-1 , it gives us : **c1=g and c2=py**
now we have everything y,g and p , calculating the secret key x ! all we know is that y=pow(g,x,p) !
Discret log is solution !! we can use Pohlig_Hellman
Sending now the secret key to the server

flag is : Securinets{B4444d_3lG4m4l_system}