I am working on a cryptography homework, doing an elgamal attack. I am using pycrypto's package.
$(a, b) = encrypt(plaintext, K)$
where
$a = g^K \bmod p$
$b = (M * (y^k \bmod p)) \bmod p$
note* $y = g^x$ where $x$ is $0$.
how do i solve for $K$ in $a$? i would assume that to find $K$ in $a$, i would first undo the $\bmod p$ then solve that for $K$?
basically all variables are known except $K$,
correction, $K$ is actually a string of randomly chosen bytes, pycrypto.Random.get_random_bytes(256)
update:
(iCrypto.PublicKey.ElGamal
ElGamalobj
(iCrypto.PublicKey.ElGamal
ElGamalobj
p1
(dp2
S'y'
L3851108076650641288865103389678956230722604113016323772542883708566042695644008397665742854007727536601555544224254199922001425133482034782803499737357184245616748558709909700229181276764625497768362623566917108742272367808698987110754258303723299827479960491382285630238295061089279364243463440349018971343L
sS'p'
L120053190728662558102422374586700575861948298252350519085804716660050499427167747567030668171459827826412019436749763634225321054729778015928332247569488011408830325041398940604454841455954677214120721456908809521766401310423837479141595303402653304941224929139831429625275738949439270847278126168426051651519L
sS'g'
L28991607564753802504963461845896331885785976942821514499992205373352914326576115941685850070173798014037739188429161396978995546358116441948086532566777217447608039716620041152660962365559509983758664678029052189336271879635235368066382762520741617211910831541515492066943985149654383092191556264270212205239L
sS'x'
L0L
sb.
this is what the professor gave us, (y,p,g) are all huge primes(i think) and x is 0