Beispiel #1
0
        /// <summary>
        /// Creates the client side hash algorithm to use.
        /// </summary>
        /// <returns>Hash algorithm</returns>
        public HashAlgorithm CreateClientHash()
        {
            //  Resolve Session ID
            var sessionId = Session.SessionId ?? ExchangeHash;

            var clientKey = Hash(GenerateSessionKey(SharedKey, ExchangeHash, 'E', sessionId));

            clientKey = GenerateSessionKey(SharedKey, ExchangeHash, clientKey, _clientHashInfo.KeySize / 8);

            //return clientHMac;
            return(_clientHashInfo.HashAlgorithm(clientKey));
        }
Beispiel #2
0
        /// <summary>
        /// Creates the server side hash algorithm to use.
        /// </summary>
        /// <returns>Hash algorithm</returns>
        public HashAlgorithm CreateServerHash()
        {
            //  Resolve Session ID
            var sessionId = Session.SessionId ?? ExchangeHash;

            var serverKey = Hash(GenerateSessionKey(SharedKey, ExchangeHash, 'F', sessionId));

            serverKey = GenerateSessionKey(SharedKey, ExchangeHash, serverKey, _serverHashInfo.KeySize / 8);

            //return serverHMac;
            return(_serverHashInfo.HashAlgorithm(serverKey));
        }