Algorithm
The LM hash is computed as follows:
- The user's password is restricted to a maximum of fourteen ASCII characters.
- The user’s password is converted to uppercase.
- This password is null-padded to 14 bytes.
- The “fixed-length” password is split into two seven-byte halves.
- 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
becomes01010100
). 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.) - 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 toNONE
. - These two ciphertext values are concatenated to form a 16-byte value, which is the LM hash.
Read more about this topic: LM Hash
Related Subjects
Related Phrases
Related Words