/** * Computes the 24 byte Unicode password hash given the 8 byte server challenge. */ public byte[] getUnicodeHash( byte[] challenge ) { if( hashesExternal ) { return unicodeHash; } switch (LM_COMPATIBILITY) { case 0: case 1: case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: /* if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getNTLMv2Response(domain, username, password, null, challenge, clientChallenge); */ return new byte[0]; default: return getNTLMResponse( password, challenge ); } }
/** * Computes the 24 byte Unicode password hash given the 8 byte server challenge. */ public byte[] getUnicodeHash( byte[] challenge ) { if( hashesExternal ) { return unicodeHash; } switch (LM_COMPATIBILITY) { case 0: case 1: case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: /* if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getNTLMv2Response(domain, username, password, null, challenge, clientChallenge); */ return new byte[0]; default: return getNTLMResponse( password, challenge ); } }
/** * Computes the 24 byte Unicode password hash given the 8 byte server challenge. */ public byte[] getUnicodeHash( byte[] challenge ) { if( hashesExternal ) { return unicodeHash; } switch (LM_COMPATIBILITY) { case 0: case 1: case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: /* if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getNTLMv2Response(domain, username, password, null, challenge, clientChallenge); */ return new byte[0]; default: return getNTLMResponse( password, challenge ); } }
/** * Computes the 24 byte Unicode password hash given the 8 byte server challenge. */ public byte[] getUnicodeHash( byte[] challenge ) { if( hashesExternal ) { return unicodeHash; } switch (LM_COMPATIBILITY) { case 0: case 1: case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: /* if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getNTLMv2Response(domain, username, password, null, challenge, clientChallenge); */ return new byte[0]; default: return getNTLMResponse( password, challenge ); } }
/** * Constructs the NT response to the given Type-2 message using * the supplied password. * * @param type2 The Type-2 message. * @param password The password. * @return A <code>byte[]</code> containing the NT response. */ public static byte[] getNTResponse(Type2Message type2, String password) { if (type2 == null || password == null) return null; return NtlmPasswordAuthentication.getNTLMResponse(password, type2.getChallenge()); }
/** * Constructs the NT response to the given Type-2 message using * the supplied password. * * @param type2 The Type-2 message. * @param password The password. * @return A <code>byte[]</code> containing the NT response. */ public static byte[] getNTResponse(Type2Message type2, String password) { if (type2 == null || password == null) return null; return NtlmPasswordAuthentication.getNTLMResponse(password, type2.getChallenge()); }
/** * Constructs the NT response to the given Type-2 message using * the supplied password. * * @param type2 The Type-2 message. * @param password The password. * @return A <code>byte[]</code> containing the NT response. */ public static byte[] getNTResponse(Type2Message type2, String password) { if (type2 == null || password == null) return null; return NtlmPasswordAuthentication.getNTLMResponse(password, type2.getChallenge()); }
/** * Constructs the NT response to the given Type-2 message using * the supplied password. * * @param type2 The Type-2 message. * @param password The password. * @return A <code>byte[]</code> containing the NT response. */ public static byte[] getNTResponse(Type2Message type2, String password) { if (type2 == null || password == null) return null; return NtlmPasswordAuthentication.getNTLMResponse(password, type2.getChallenge()); }
/** * Computes the 24 byte ANSI password hash given the 8 byte server challenge. */ public byte[] getAnsiHash( byte[] challenge ) { if( hashesExternal ) { return ansiHash; } switch (LM_COMPATIBILITY) { case 0: case 1: return getPreNTLMResponse( password, challenge ); case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getLMv2Response(domain, username, password, challenge, clientChallenge); default: return getPreNTLMResponse( password, challenge ); } } /**
/** * Computes the 24 byte ANSI password hash given the 8 byte server challenge. */ public byte[] getAnsiHash( byte[] challenge ) { if( hashesExternal ) { return ansiHash; } switch (LM_COMPATIBILITY) { case 0: case 1: return getPreNTLMResponse( password, challenge ); case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getLMv2Response(domain, username, password, challenge, clientChallenge); default: return getPreNTLMResponse( password, challenge ); } } /**
/** * Computes the 24 byte ANSI password hash given the 8 byte server challenge. */ public byte[] getAnsiHash( byte[] challenge ) { if( hashesExternal ) { return ansiHash; } switch (LM_COMPATIBILITY) { case 0: case 1: return getPreNTLMResponse( password, challenge ); case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getLMv2Response(domain, username, password, challenge, clientChallenge); default: return getPreNTLMResponse( password, challenge ); } } /**
/** * Computes the 24 byte ANSI password hash given the 8 byte server challenge. */ public byte[] getAnsiHash( byte[] challenge ) { if( hashesExternal ) { return ansiHash; } switch (LM_COMPATIBILITY) { case 0: case 1: return getPreNTLMResponse( password, challenge ); case 2: return getNTLMResponse( password, challenge ); case 3: case 4: case 5: if( clientChallenge == null ) { clientChallenge = new byte[8]; RANDOM.nextBytes( clientChallenge ); } return getLMv2Response(domain, username, password, challenge, clientChallenge); default: return getPreNTLMResponse( password, challenge ); } } /**
byte[] lmResponse = NtlmPasswordAuthentication.getPreNTLMResponse( credentials.getPassword(), challenge); byte[] ntResponse = NtlmPasswordAuthentication.getNTLMResponse( credentials.getPassword(), challenge); type3 = new Type3Message(flags, lmResponse, ntResponse,
final byte[] ntResponse = NtlmPasswordAuthentication.getNTLMResponse ( this.credentials.getPassword (), challenge ); type3 = new Type3Message ( flags, lmResponse, ntResponse, target, this.credentials.getUsername (), Type3Message.getDefaultWorkstation () ); if ( ( flags & NtlmFlags.NTLMSSP_NEGOTIATE_KEY_EXCH ) != 0 )
byte[] lmResponse = NtlmPasswordAuthentication.getPreNTLMResponse( credentials.getPassword(), challenge); byte[] ntResponse = NtlmPasswordAuthentication.getNTLMResponse( credentials.getPassword(), challenge); type3 = new Type3Message(flags, lmResponse, ntResponse,