mirror of
https://github.com/raphaeIl/Novaria.git
synced 2025-12-12 14:34:38 +01:00
pcap loader, first login packet
This commit is contained in:
@@ -126,6 +126,7 @@ namespace Novaria.Common.Core
|
||||
if (!success)
|
||||
{
|
||||
Log.Error("something went wrong when chacha20 decrypting the data");
|
||||
throw new InvalidDataException("something went wrong when chacha20 decrypting the data");
|
||||
}
|
||||
|
||||
byte[] decrypted_bytes = decrypt_result.ToArray();
|
||||
|
||||
@@ -24,7 +24,15 @@ namespace Novaria.Common.Crypto
|
||||
BigInteger clientPubKeyInt = new BigInteger(clientPubKey.Reverse().ToArray());
|
||||
|
||||
//Cpub**Spriv mod p
|
||||
return BigInteger.ModPow(clientPubKeyInt, spriv, p).ToByteArray(true, true)[..32];
|
||||
Console.WriteLine(clientPubKeyInt.ToString());
|
||||
|
||||
var result = BigInteger.ModPow(clientPubKeyInt, spriv, p);
|
||||
if (result < 0)
|
||||
{
|
||||
result += p; // Make the result non-negative, causes error if -
|
||||
}
|
||||
|
||||
return result.ToByteArray(true, true)[..32];
|
||||
}
|
||||
|
||||
// this is for manual pcap parsing use only, officalServerPubKey is in the first IKE response, client priv will be in frida
|
||||
|
||||
Reference in New Issue
Block a user