Hash Based Key Stretching
A collision prone simple key stretching method:
key = hash(password) for 1 to 65536 do key = hash(key)A better simple key stretching method. ("+" denotes the operation of concatenation):
key = "" for 1 to 65536 do key = hash(key + password)Even better method with a salt:
key = "" for 1 to 65536 do key = hash(key + password + salt)Many libraries provide functions which perform key stretching as part of their function; see crypt(3) for an example. Note that PBKDF2 is for generating an encryption key from a password, and not necessarily for password authentication. PBKDF2 can be used for both if the number of output bits is less than or equal to the internal hashing algorithm used in PBKDF2 which is usually SHA-1 (160 bits) or used as an encryption key to encrypt static data.
Read more about this topic: Key Stretching
Famous quotes containing the words based, key and/or stretching:
“The time must come, my friend ... when brutality and the lust for power must perish by its own sword.... For when that day comes, the world must begin to look for a new life, and it is our hope that they may find it here. For here we shall be, with their books, and their music, and a way of life based on one simple rule: Be kind.”
—Robert Riskin (18971955)
“Experience has shown that the trade of the East is the key to national wealth and influence.”
—Chester A. Arthur (18291886)
“There was now no road further, the river being the only highway, and but half a dozen log huts, confined to its banks, to be met with for thirty miles. On either hand, and beyond, was a wholly uninhabited wilderness, stretching to Canada.”
—Henry David Thoreau (18171862)