lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sun, 6 Apr 2014 14:08:59 -0400
From: Bill Cox <waywardgeek@...il.com>
To: discussions@...sword-hashing.net
Subject: Re: [PHC] pufferfish

On Sun, Apr 6, 2014 at 10:56 AM, Jeremi Gosney <epixoip@...dshell.nl> wrote:
> On 4/6/2014 7:48 AM, Jeremi Gosney wrote:
>> This should work for what you want to do. But note that in this context
>> outlen is now specified in bits, not bytes.
>>
>> --- a/src/common/api.c
>> +++ b/src/common/api.c
>> @@ -123,18 +123,10 @@ int PHS (void *out, size_t outlen, const void *in,
>> size_t inlen, const void *sal
>>  {
>>          /* required PHS api */
>>
>> -        char *hash;
>> -        char *settings = pf_gensalt (salt, saltlen, t_cost, m_cost);
>> +        unsigned char *bytes = pfkdf (outlen, in, t_cost, m_cost);
>>
>> -        if (! (hash = (char *) pufferfish (in, inlen, settings, outlen,
>> false)))
>> -        {
>> -                free (settings);
>> -                return 1;
>> -        }
>> -
>> -        memmove (out, hash, strlen (hash));
>> -        free (settings);
>> -        free (hash);
>> +        memmove (out, bytes, outlen);
>> +        free (bytes);
>>
>>          return 0;
>>  }
>
>
> Oops, sorry.  That should be:
>
> memmove (out, bytes, outlen/8);
>
> Not
>
> memmove (out, bytes, outlen);

This looks good.  If you don't mind, I'll pass outlen*8 to pfkdf
instead of dividing by 8 on the return.  That will make outlen's
meaning match all the other entries.

Bill

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ