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 fetish of the great university, of expensive colleges for young women, is too often simply a fetish. It is not based on a genuine desire for learning. Education today need not be sought at any great distance. It is largely compounded of two things, of a certain snobbishness on the part of parents, and of escape from home on the part of youth. And to those who must earn quickly it is often sheer waste of time. Very few colleges prepare their students for any special work.”
—Mary Roberts Rinehart (18761958)
“This is the Key of the Kingdom:
In that Kingdom is a city;”
—Unknown. This Is the Key (l. 12)
“O sleep, O gentle sleep,
Natures soft nurse, how have I frighted thee,
That thou no more wilt weigh my eyelids down
And steep my senses in forgetfulness?
Why rather, sleep, liest thou in smoky cribs,
Upon uneasy pallets stretching thee,
And hushed with buzzing night-flies to thy slumber,
Than in the perfumed chambers of the great,
Under the canopies of costly state,
And lulled with sound of sweetest melody?”
—William Shakespeare (15641616)