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:

    Language makes it possible for a child to incorporate his parents’ verbal prohibitions, to make them part of himself....We don’t speak of a conscience yet in the child who is just acquiring language, but we can see very clearly how language plays an indispensable role in the formation of conscience. In fact, the moral achievement of man, the whole complex of factors that go into the organization of conscience is very largely based upon language.
    Selma H. Fraiberg (20th century)

    It so happened that, a few weeks later, “Old Ernie” [Ernest Hemingway] himself was using my room in New York as a hide-out from literary columnists and reporters during one of his rare stopover visits between Africa and Key West. On such all-too-rare occasions he lends an air of virility to my dainty apartment which I miss sorely after he has gone and all the furniture has been repaired.
    Robert Benchley (1889–1945)

    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 (1817–1862)