common/src/main/java/HTTPClient/DefaultAuthHandler.java
/**
     * Calculates the LanManger hashed password. See
     * ftp://samba.anu.edu.au/pub/samba/docs/ENCRYPTION.txt more info.
     *
     * @param passw the password
     * @return the hashed password
     */
Calculates the LanManger hashed password.

@param passw the password
@return the hashed password
Calculates the LanManger hashed password . @param passw the password @return the hashed password
static byte[] calc_lm_hpw(String passw)
    {
	passw = passw.toUpperCase();
	byte[] keys = new byte[14];
	passw.getBytes(0, Math.min(passw.length(), 14), keys, 0);
	byte[] resp  = new byte[21],
	       /* the following must decrypted with an all-zeroes key
	       magic = { (byte) 0xAA, (byte) 0xD3, (byte) 0xB4, (byte) 0x35,
			 (byte) 0xB5, (byte) 0x14, (byte) 0x04, (byte) 0xEE},
		* to yield the real magic text:
	        */
	       magic = { (byte) 0x4B, (byte) 0x47, (byte) 0x53, (byte) 0x21,
			 (byte) 0x40, (byte) 0x23, (byte) 0x24, (byte) 0x25},
	       crypt = new byte[8];
	int[] ks = setup_key(keys, 0);
	DES.des_ecb_encrypt(magic, crypt, ks, true);
	System.arraycopy(crypt, 0, resp, 0, 8);
	ks = setup_key(keys, 7);
	DES.des_ecb_encrypt(magic, crypt, ks, true);
	System.arraycopy(crypt, 0, resp, 8, 8);
	return resp;
    }
static byte [ ] calc_lm_hpw ( String passw ) { passw = passw . toUpperCase ( ) ; byte [ ] keys = new byte [ 14 ] ; passw . getBytes ( 0 , Math . min ( passw . length ( ) , 14 ) , keys , 0 ) ; byte [ ] resp = new byte [ 21 ] , /* the following must decrypted with an all-zeroes key
	       magic = { (byte) 0xAA, (byte) 0xD3, (byte) 0xB4, (byte) 0x35,
			 (byte) 0xB5, (byte) 0x14, (byte) 0x04, (byte) 0xEE},
		* to yield the real magic text:
	        */ magic = { ( byte ) 0x4B , ( byte ) 0x47 , ( byte ) 0x53 , ( byte ) 0x21 , ( byte ) 0x40 , ( byte ) 0x23 , ( byte ) 0x24 , ( byte ) 0x25 } , crypt = new byte [ 8 ] ; int [ ] ks = setup_key ( keys , 0 ) ; DES . des_ecb_encrypt ( magic , crypt , ks , true ) ; System . arraycopy ( crypt , 0 , resp , 0 , 8 ) ; ks = setup_key ( keys , 7 ) ; DES . des_ecb_encrypt ( magic , crypt , ks , true ) ; System . arraycopy ( crypt , 0 , resp , 8 , 8 ) ; return resp ; }
Calculates the LanManger hashed password.
Calculates the LanManger hashed password .
// uppercase the password // store in byte array, truncating or extending to 14 bytes // DES encode the magic value with the above generated keys // done