Key Stretching - Hash Based Key Stretching

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:

    What strikes many twin researchers now is not how much identical twins are alike, but rather how different they are, given the same genetic makeup....Multiples don’t walk around in lockstep, talking in unison, thinking identical thoughts. The bond for normal twins, whether they are identical or fraternal, is based on how they, as individuals who are keenly aware of the differences between them, learn to relate to one another.
    Pamela Patrick Novotny (20th century)

    As soon as you are in a social setting, you better take away the key to the lock of your heart and pocket it; those who leave the key in the lock are fools.
    Johann Wolfgang Von Goethe (1749–1832)

    O sleep, O gentle sleep,
    Nature’s 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 (1564–1616)