I want to implement an ElGamal encryption from this link https://csharp.hotexamples.com/examples/Portable.Licensing.Security.Cryptography.ElGamal/ElGamalKeyStruct/-/php-elgamalkeystruct-class-examples.html
This is what I have tried so far and have no luck
string lic = "abcdefghijklmnopqrstuvwxyz";
byte[] licenseKey = Encoding.UTF8.GetBytes(lic);
ElGamalKeyStruct key = new ElGamalKeyStruct();
key.P = new BigInteger(123567890);
key.G = new BigInteger(1234567890);
key.Y = new BigInteger(1234567890);
key.X = new BigInteger(0); //zero
byte[] signature = CreateSignature(licenseKey, key);
bool verified = VerifySignature(licenseKey, signature, key);
The VerifySignature
always returns false
.