im guessing the problem is with this part but i can't tell since its a bit confusing anyway ill run the source code i have locally and see if it returns the same keys
Code:
static void SetUpCrypto(Client C)
{
try
{
BigNumber RealClientPublicKey = BigNumber.FromHexString(C.ClientDataDHP.Client_PubKey);
BigNumber RealServerPublicKey = BigNumber.FromHexString(C.ServerDataDHP.Server_PubKey);
GameCrypto ClientCrypto = new GameCrypto((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey));
GameCrypto ServerCrypto = new GameCrypto((C.ServerCrypt).DH.ComputeKey(RealClientPublicKey));
ClientCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ClientIV;
ClientCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ClientIV;
C.ClientCrypt = ClientCrypto;
C.ServerCrypt = ServerCrypto;
C.Exchanging = false;
}
catch { }
}
Edit:tested it locally and had no problems with the exchange packs probably the handling then
Edit:And not the handling so WTF
Edit:Found the problem this it was supposed to be like this
Code:
static void SetUpCrypto(Client C)
{
try
{
BigNumber RealClientPublicKey = BigNumber.FromHexString(C.ClientDataDHP.Client_PubKey);
BigNumber RealServerPublicKey = BigNumber.FromHexString(C.ServerDataDHP.Server_PubKey);
GameCrypto ClientCrypto = new GameCrypto((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey));
GameCrypto ServerCrypto = new GameCrypto(C.ClientDataDHP.DHKey((C.ServerCrypt).DH.ComputeKey(RealClientPublicKey)));
ClientCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ClientIV;
ClientCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.EncryptIV = C.ServerDataDHP.ServerIV;
ServerCrypto.Blowfish.DecryptIV = C.ServerDataDHP.ClientIV;
C.ClientCrypt = ClientCrypto;
C.ServerCrypt = ServerCrypto;
C.Exchanging = false;
}
catch { }
}
but still the client isn't loading but i'll assume the crypto is setup correctly for now well that's one problem dealt with
Edit:i was wrong there is a problem with the client crypto
Edit:Changing
Code:
GameCrypto ClientCrypto = new GameCrypto((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey));
to
Code:
GameCrypto ClientCrypto = new GameCrypto(C.ServerDataDHP.DHKey((C.ClientCrypt).DH.ComputeKey(RealServerPublicKey)));
fixed the problem now it works thnx for your help and your amazing yet a bit confusing proxy