LM Hash - Algorithm

Algorithm

The LM hash is computed as follows:

  1. The user's password is restricted to a maximum of fourteen ASCII characters.
  2. The user’s password is converted to uppercase.
  3. This password is null-padded to 14 bytes.
  4. The “fixed-length” password is split into two seven-byte halves.
  5. These values are used to create two DES keys, one from each 7-byte half, by converting the seven bytes into a bit stream, and inserting a null bit after every seven bits (so 1010100 becomes 01010100). This generates the 64 bits needed for a DES key. (A DES key ostensibly consists of 64 bits; however, only 56 of these are actually used by the algorithm. The null bits added in this step are later discarded.)
  6. Each of the two keys is used to DES-encrypt the constant ASCII string “KGS!@#$%”, resulting in two 8-byte ciphertext values. The DES CipherMode should be set to ECB, and PaddingMode should be set to NONE.
  7. These two ciphertext values are concatenated to form a 16-byte value, which is the LM hash.

Read more about this topic:  LM Hash