public class NTLMResponses
extends java.lang.Object
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
LM_HASH_MAGIC_CONSTANT |
| 构造器和说明 |
|---|
NTLMResponses() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
getLMResponse(java.lang.String password,
byte[] challenge)
Calculates the LM Response for the given challenge, using the specified
password.
|
static byte[] |
getLMv2Response(java.lang.String target,
java.lang.String user,
java.lang.String password,
byte[] challenge,
byte[] clientNonce)
Calculates the LMv2 Response for the given challenge, using the
specified authentication target, username, password, and client
challenge.
|
static byte[] |
getNTLM2SessionResponse(java.lang.String password,
byte[] challenge,
byte[] clientNonce)
Calculates the NTLM2 Session Response for the given challenge, using the
specified password and client nonce.
|
static byte[] |
getNTLMResponse(java.lang.String password,
byte[] challenge)
Calculates the NTLM Response for the given challenge, using the
specified password.
|
static byte[] |
getNTLMv2Response(java.lang.String target,
java.lang.String user,
java.lang.String password,
byte[] targetInformation,
byte[] challenge,
byte[] clientNonce)
Calculates the NTLMv2 Response for the given challenge, using the
specified authentication target, username, password, target information
block, and client nonce.
|
static byte[] |
getNTLMv2Response(java.lang.String target,
java.lang.String user,
java.lang.String password,
byte[] targetInformation,
byte[] challenge,
byte[] clientNonce,
long time)
Calculates the NTLMv2 Response for the given challenge, using the
specified authentication target, username, password, target information
block, and client nonce.
|
static byte[] |
hmacMD5(byte[] data,
byte[] key)
Calculates the HMAC-MD5 hash of the given data using the specified
hashing key.
|
public static byte[] getLMResponse(java.lang.String password,
byte[] challenge)
throws java.lang.Exception
password - The user's password.challenge - The Type 2 challenge from the server.java.lang.Exception - If something went wrongpublic static byte[] getNTLMResponse(java.lang.String password,
byte[] challenge)
throws java.lang.Exception
password - The user's password.challenge - The Type 2 challenge from the server.java.lang.Exception - If something went wrongpublic static byte[] getNTLMv2Response(java.lang.String target,
java.lang.String user,
java.lang.String password,
byte[] targetInformation,
byte[] challenge,
byte[] clientNonce)
throws java.lang.Exception
target - The authentication target (i.e., domain).user - The username.password - The user's password.targetInformation - The target information block from the Type 2
message.challenge - The Type 2 challenge from the server.clientNonce - The random 8-byte client nonce.java.lang.Exception - If something went wrongpublic static byte[] getNTLMv2Response(java.lang.String target,
java.lang.String user,
java.lang.String password,
byte[] targetInformation,
byte[] challenge,
byte[] clientNonce,
long time)
throws java.lang.Exception
target - The authentication target (i.e., domain).user - The username.password - The user's password.targetInformation - The target information block from the Type 2
message.challenge - The Type 2 challenge from the server.clientNonce - The random 8-byte client nonce.time - The time stamp.java.lang.Exception - If something went wrongpublic static byte[] getLMv2Response(java.lang.String target,
java.lang.String user,
java.lang.String password,
byte[] challenge,
byte[] clientNonce)
throws java.lang.Exception
target - The authentication target (i.e., domain).user - The username.password - The user's password.challenge - The Type 2 challenge from the server.clientNonce - The random 8-byte client nonce.java.lang.Exception - If something went wrongpublic static byte[] getNTLM2SessionResponse(java.lang.String password,
byte[] challenge,
byte[] clientNonce)
throws java.lang.Exception
password - The user's password.challenge - The Type 2 challenge from the server.clientNonce - The random 8-byte client nonce.java.lang.Exception - If something went wrongpublic static byte[] hmacMD5(byte[] data,
byte[] key)
throws java.lang.Exception
data - The data for which the hash will be calculated.key - The hashing key.java.lang.Exception - If something went wrong