static byte[] computeResponse(byte[] responseKey, byte[] serverChallenge, byte[] clientData, int offset, int length) { HMACT64 hmac = new HMACT64(responseKey); hmac.update(serverChallenge); hmac.update(clientData, offset, length); byte[] mac = hmac.digest(); byte[] ret = new byte[mac.length + clientData.length]; System.arraycopy(mac, 0, ret, 0, mac.length); System.arraycopy(clientData, 0, ret, mac.length, clientData.length); return ret; } public static byte[] getLMv2Response(
static byte[] computeResponse(byte[] responseKey, byte[] serverChallenge, byte[] clientData, int offset, int length) { HMACT64 hmac = new HMACT64(responseKey); hmac.update(serverChallenge); hmac.update(clientData, offset, length); byte[] mac = hmac.digest(); byte[] ret = new byte[mac.length + clientData.length]; System.arraycopy(mac, 0, ret, 0, mac.length); System.arraycopy(clientData, 0, ret, mac.length, clientData.length); return ret; } public static byte[] getLMv2Response(
public static byte[] nTOWFv2(String domain, String username, String password) { try { MD4 md4 = new MD4(); md4.update(password.getBytes(SmbConstants.UNI_ENCODING)); HMACT64 hmac = new HMACT64(md4.digest()); hmac.update(username.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac.update(domain.getBytes(SmbConstants.UNI_ENCODING)); return hmac.digest(); } catch (UnsupportedEncodingException uee) { throw new RuntimeException(uee.getMessage()); } } static byte[] computeResponse(byte[] responseKey,
public static byte[] nTOWFv2(String domain, String username, String password) { try { MD4 md4 = new MD4(); md4.update(password.getBytes(SmbConstants.UNI_ENCODING)); HMACT64 hmac = new HMACT64(md4.digest()); hmac.update(username.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac.update(domain.getBytes(SmbConstants.UNI_ENCODING)); return hmac.digest(); } catch (UnsupportedEncodingException uee) { throw new RuntimeException(uee.getMessage()); } } static byte[] computeResponse(byte[] responseKey,
static byte[] computeResponse(byte[] responseKey, byte[] serverChallenge, byte[] clientData, int offset, int length) { HMACT64 hmac = new HMACT64(responseKey); hmac.update(serverChallenge); hmac.update(clientData, offset, length); byte[] mac = hmac.digest(); byte[] ret = new byte[mac.length + clientData.length]; System.arraycopy(mac, 0, ret, 0, mac.length); System.arraycopy(clientData, 0, ret, mac.length, clientData.length); return ret; } public static byte[] getLMv2Response(
public static byte[] nTOWFv2(String domain, String username, String password) { try { MD4 md4 = new MD4(); md4.update(password.getBytes(SmbConstants.UNI_ENCODING)); HMACT64 hmac = new HMACT64(md4.digest()); hmac.update(username.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac.update(domain.getBytes(SmbConstants.UNI_ENCODING)); return hmac.digest(); } catch (UnsupportedEncodingException uee) { throw new RuntimeException(uee.getMessage()); } } static byte[] computeResponse(byte[] responseKey,
hmac.update(user.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac.update(domain.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac = new HMACT64(hmac.digest()); hmac.update(challenge); hmac.update(clientChallenge); hmac.digest(response, 0, 16); System.arraycopy(clientChallenge, 0, response, 16, 8); return response;
hmac.update(user.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac.update(domain.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac = new HMACT64(hmac.digest()); hmac.update(challenge); hmac.update(clientChallenge); hmac.digest(response, 0, 16); System.arraycopy(clientChallenge, 0, response, 16, 8); return response;
hmac.update(user.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac.update(domain.toUpperCase().getBytes(SmbConstants.UNI_ENCODING)); hmac = new HMACT64(hmac.digest()); hmac.update(challenge); hmac.update(clientChallenge); hmac.digest(response, 0, 16); System.arraycopy(clientChallenge, 0, response, 16, 8); return response;
hmac.update(domain.toUpperCase().getBytes( SmbConstants.UNI_ENCODING)); byte[] ntlmv2Hash = hmac.digest(); hmac = new HMACT64(ntlmv2Hash); hmac.update(challenge); hmac.update(clientChallenge); HMACT64 userKey = new HMACT64(ntlmv2Hash); userKey.update(hmac.digest()); userKey.digest(dest, offset, 16); break; default:
hmac.update(domain.toUpperCase().getBytes( SmbConstants.UNI_ENCODING)); byte[] ntlmv2Hash = hmac.digest(); hmac = new HMACT64(ntlmv2Hash); hmac.update(challenge); hmac.update(clientChallenge); HMACT64 userKey = new HMACT64(ntlmv2Hash); userKey.update(hmac.digest()); userKey.digest(dest, offset, 16); break; default:
hmac.update(domain.toUpperCase().getBytes( SmbConstants.UNI_ENCODING)); byte[] ntlmv2Hash = hmac.digest(); hmac = new HMACT64(ntlmv2Hash); hmac.update(challenge); hmac.update(clientChallenge); HMACT64 userKey = new HMACT64(ntlmv2Hash); userKey.update(hmac.digest()); userKey.digest(dest, offset, 16); break; default: