/** * * @param password * @return the calculated hash */ public static byte[] nTOWFv1 ( String password ) { if ( password == null ) throw new NullPointerException("Password parameter is required"); MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(password)); return md4.digest(); }
/** * * @param password * @return the calculated hash */ public static byte[] nTOWFv1 ( String password ) { if ( password == null ) throw new NullPointerException("Password parameter is required"); MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(password)); return md4.digest(); }
/** * Generate the Unicode MD4 hash for the password associated with these credentials. * * @param password * @param challenge * @return the calculated response * @throws GeneralSecurityException */ static public byte[] getNTLMResponse ( String password, byte[] challenge ) throws GeneralSecurityException { byte[] p21 = new byte[21]; byte[] p24 = new byte[24]; byte[] uni = Strings.getUNIBytes(password); MessageDigest md4 = Crypto.getMD4(); md4.update(uni); md4.digest(p21, 0, 16); NtlmUtil.E(p21, challenge, p24); return p24; }
/** * * @param domain * @param username * @param password * * @return the caclulated mac */ public static byte[] nTOWFv2 ( String domain, String username, String password ) { MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(password)); MessageDigest hmac = Crypto.getHMACT64(md4.digest()); hmac.update(Strings.getUNIBytes(username.toUpperCase())); hmac.update(Strings.getUNIBytes(domain)); return hmac.digest(); }
/** * Generate the Unicode MD4 hash for the password associated with these credentials. * * @param password * @param challenge * @return the calculated response * @throws GeneralSecurityException */ static public byte[] getNTLMResponse ( String password, byte[] challenge ) throws GeneralSecurityException { byte[] p21 = new byte[21]; byte[] p24 = new byte[24]; byte[] uni = Strings.getUNIBytes(password); MessageDigest md4 = Crypto.getMD4(); md4.update(uni); md4.digest(p21, 0, 16); NtlmUtil.E(p21, challenge, p24); return p24; }
/** * * @param domain * @param username * @param password * * @return the caclulated mac */ public static byte[] nTOWFv2 ( String domain, String username, String password ) { MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(password)); MessageDigest hmac = Crypto.getHMACT64(md4.digest()); hmac.update(Strings.getUNIBytes(username.toUpperCase())); hmac.update(Strings.getUNIBytes(domain)); return hmac.digest(); }
byte[] response = new byte[24]; MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(password)); MessageDigest hmac = Crypto.getHMACT64(md4.digest());
byte[] response = new byte[24]; MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(password)); MessageDigest hmac = Crypto.getHMACT64(md4.digest());
MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(this.password)); switch ( tc.getConfig().getLanManCompatibility() ) {
MessageDigest md4 = Crypto.getMD4(); md4.update(Strings.getUNIBytes(this.password)); switch ( tc.getConfig().getLanManCompatibility() ) {
System.arraycopy(clientChallenge, 0, sessionNonce, 8, 8); MessageDigest md4 = Crypto.getMD4(); md4.update(responseKeyNT); byte[] userSessionKey = md4.digest();
System.arraycopy(clientChallenge, 0, sessionNonce, 8, 8); MessageDigest md4 = Crypto.getMD4(); md4.update(responseKeyNT); byte[] userSessionKey = md4.digest();