src/Robin/Ntlm/Message/NtlmV1AuthenticateMessageEncoder.php
public function calculateNtResponse(
        HashCredentialInterface $hash_credential,
        $client_challenge = null,
        $server_challenge_nonce = null
    ) {
        // By default, our encryption data is our server challenge nonce
        $encryption_data = $server_challenge_nonce;

        // If we have a client challenge, extended session security must be negotiated
        if (null !== $client_challenge) {
            // Grab a hasher
            $extended_security_hasher = $this->crypt_hasher_factory->build(
                static::EXTENDED_SESSION_SECURITY_HASHER_ALGORITHM
            );

            // Concat the two challenge strings
            $nt_extended_security_challenge_source = $server_challenge_nonce . $client_challenge;

            $nt_extended_security_hash = $extended_security_hasher
                ->update($nt_extended_security_challenge_source)
                ->digest();

            // Our challenge is a substring of the resulting hash
            $nt_extended_security_challenge = substr(
                $nt_extended_security_hash,
                0,
                static::EXTENDED_SESSION_SECURITY_CHALLENGE_LENGTH
            );

            $encryption_data = $nt_extended_security_challenge;
        }

        return $this->calculateChallengeResponseData($hash_credential, $encryption_data);
    }
public function calculateNtResponse(
        HashCredentialInterface $hash_credential,
        $client_challenge = null,
        $server_challenge_nonce = null
    ) {
        // By default, our encryption data is our server challenge nonce
        $encryption_data = $server_challenge_nonce;

        // If we have a client challenge, extended session security must be negotiated
        if (null !== $client_challenge) {
            // Grab a hasher
            $extended_security_hasher = $this->crypt_hasher_factory->build(
                static::EXTENDED_SESSION_SECURITY_HASHER_ALGORITHM
            );

            // Concat the two challenge strings
            $nt_extended_security_challenge_source = $server_challenge_nonce . $client_challenge;

            $nt_extended_security_hash = $extended_security_hasher
                ->update($nt_extended_security_challenge_source)
                ->digest();

            // Our challenge is a substring of the resulting hash
            $nt_extended_security_challenge = substr(
                $nt_extended_security_hash,
                0,
                static::EXTENDED_SESSION_SECURITY_CHALLENGE_LENGTH
            );

            $encryption_data = $nt_extended_security_challenge;
        }

        return $this->calculateChallengeResponseData($hash_credential, $encryption_data);
    }
public function calculateNtResponse ( HashCredentialInterface $ hash_credential , $ client_challenge = null , $ server_challenge_nonce = null ) { // By default, our encryption data is our server challenge nonce $ encryption_data = $ server_challenge_nonce ; // If we have a client challenge, extended session security must be negotiated if ( null !== $ client_challenge ) { // Grab a hasher $ extended_security_hasher = $ this -> crypt_hasher_factory -> build ( static :: EXTENDED_SESSION_SECURITY_HASHER_ALGORITHM ) ; // Concat the two challenge strings $ nt_extended_security_challenge_source = $ server_challenge_nonce . $ client_challenge ; $ nt_extended_security_hash = $ extended_security_hasher -> update ( $ nt_extended_security_challenge_source ) -> digest ( ) ; // Our challenge is a substring of the resulting hash $ nt_extended_security_challenge = substr ( $ nt_extended_security_hash , 0 , static :: EXTENDED_SESSION_SECURITY_CHALLENGE_LENGTH ) ; $ encryption_data = $ nt_extended_security_challenge ; } return $ this -> calculateChallengeResponseData ( $ hash_credential , $ encryption_data ) ; }
Calculates the NT response.

@param HashCredentialInterface $hash_credential The user's authentication
NT hash credential.
@param string|null $client_challenge A randomly generated 64-bit (8-byte)
unsigned client-generated binary string.
@param string|null $server_challenge_nonce The 64-bit (8-byte) unsigned
server-sent "nonce" (number used once) represented as a binary string.
@return string The calculated response as a binary string.
Calculates the NT response .