Rewrote AES stream & Perform "SessionCheck" in advance

This commit is contained in:
BruceChen 2022-08-27 23:01:28 +08:00
parent a3971f9097
commit 13d1a9856a
28 changed files with 306 additions and 2807 deletions

View file

@ -11,8 +11,10 @@ namespace MinecraftClient.Crypto
/// Methods for handling all the crypto stuff: RSA (Encryption Key Request), AES (Encrypted Stream), SHA-1 (Server Hash).
/// </summary>
public class CryptoHandler
public static class CryptoHandler
{
public static byte[]? ClientAESPrivateKey = null;
/// <summary>
/// Get a cryptographic service for encrypting data using the server's RSA public key
/// </summary>
@ -202,7 +204,7 @@ namespace MinecraftClient.Crypto
public static IAesStream getAesStream(Stream underlyingStream, byte[] AesKey)
{
// return new Streams.RegularAesStream(underlyingStream, AesKey);
return new Streams.MonoAesStream(underlyingStream, AesKey);
return new Streams.AesCfb8Stream(underlyingStream, AesKey);
}
}
}