• Not so many with SHA-1 or one of the SHA-2 family with 100 rounds, either. You're not arguing for encryption vs. hashing, you're arguing for enough rounds to take more time vs. not enough rounds (say, 1).

    I am arguing for one way encryption rather than hashing. Hashing functions are ridiculously fast. even with a hundred rounds you can try 10000 passwords per second as shown by the following sample php I wrote for you.

    <?php

    function gcrypt($ename,$emode,$text,$key,$ivtext,$crypt)

    {

    $encrypted_data="";

    $td = mcrypt_module_open($ename, '', $emode, '');

    if( $td==false ){echo "could not open crypt module ".$ename;return "";}

    $ivlen = mcrypt_enc_get_iv_size($td);

    $keylen = mcrypt_enc_get_key_size($td);

    $iv = substr( $ivtext, 0, $ivlen );

    $key = substr($key, 0, $keylen);

    // echo "key=$key.$keylen.$ivlen.$iv.";

    $s = mcrypt_generic_init($td, $key, $iv);

    if( ($s < 0) || ($s === false))dieres( "hasher mcrypt_generic_init failed" );

    if($crypt){

    $edata = mcrypt_generic($td, $text);

    }else {

    $edata = mdecrypt_generic($td, $text);

    }

    mcrypt_generic_deinit($td);

    mcrypt_module_close($td);

    return $edata;

    }

    function hasher($ename,$emode,$text,$ivtext)

    {

    $key = strrev($text)."kjlsdflsdakjflsdkafjjsldkjflkj";

    return gcrypt($ename,$emode,$text,$key,$ivtext,1);

    }

    function pass2key( $algo, $text, $ivtext )

    {

    $ivtext = mb_strtolower( $ivtext, 'UTF-8' );

    $ivtext .= "lksadfkjsadfsadfhsdaklfsadlkfj";

    $text = substr( $text."lsdkfjsdalkfjsdalkfjsldakfjlsdakjfjlksdafjsdkaj", 0, 64 );

    for( $i=0;$i<1000;$i++ ){

    $text = hasher( $algo, 'cbc', $text, $ivtext );

    }

    return $text;

    }

    function timealgo( $algo )

    {

    $start = microtime( true );

    pass2key( $algo, "This is a test password", "username" );

    echo "algo- $algo:".(microtime(true)-$start)."";

    }

    function pass2key2( $hash, $text )

    {

    $text = substr( $text."lsdkfjsdalkfjsdalkfjsldakfjlsdakjfjlksdafjsdkaj", 0, 64 );

    for( $i=0;$i<1000;$i++ ){

    $text = hash( $hash, $text, true );

    }

    return $text;

    }

    function timehash( $algo )

    {

    $start = microtime( true );

    pass2key2( $algo, "This is a test password" );

    echo "hash- $algo:".(microtime(true)-$start)."";

    }

    timealgo( 'blowfish' );

    timealgo( 'twofish' );

    timehash( 'sha512' );

    timehash( 'sha256' );

    ?>

    Sample times on one of my dedis:

    algo- blowfish:0.75880813598633

    algo- twofish:0.43758201599121

    hash- sha512:0.0042619705200195

    hash- sha256:0.00357985496521

    As you can see blowfish or twofish or any other encryption algo is 100 times slower than any hashing algorithms for a matching number of rounds. It is ridiculous to use hashing algorithms to store passwords.

    You'd better require them to disclose the method and/or passphrase they use to generate the encryption key as well, because the strongest encryption is worthless when the key and/or passphrase is worthless.

    If you encrypt a password with itself with a suitable salt and the user name as iv. Then there is no need to store the encryption key for some one to hack it. The original password cant be recovered from the hash even though it is a symmetric encryption. As you can see the sample program above uses the password to encrypt itself. there is no way to go back to the password from the resulting key is there?