Ejemplo n.º 1
0
        public void Dispose()
        {
            DecryptSHA1.Dispose();
            EncryptSHA1.Dispose();

            IsInitialized = false;
        }
Ejemplo n.º 2
0
        public void Dispose()
        {
            SARC4Encrypt.Dispose();
            SARC4Decrypt.Dispose();
            DecryptSHA1.Dispose();
            EncryptSHA1.Dispose();

            GC.SuppressFinalize(this);

            IsInitialized = false;
        }
Ejemplo n.º 3
0
        public EncryptionKeyRequest(EnhancedStream stream, byte[] sharedSecret, string sessionID, string username)
        {
            string serverID = stream.ReadString();

            byte[] publicKey = stream.ReadData(stream.ReadShort());
            byte[] token     = stream.ReadData(stream.ReadShort());

            _encryptedToken        = EncryptSHA1.RSAEnc(token, publicKey);
            _encryptedSharedSecret = EncryptSHA1.RSAEnc(sharedSecret, publicKey);
            byte[] data          = Encoding.UTF8.GetBytes(serverID).Concat(sharedSecret).Concat(publicKey).ToArray();
            string serverSHAHash = EncryptSHA1.JavaHexDigest(data);

            Authentication.Authentication.HttpRequest(username, sessionID, serverSHAHash);
        }