Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 18 Jul 2012 18:43:11 +0530
From: Dhiru Kholia <>
Subject: Re: Pwsafe, is our algorithm right?

On Wed, Jul 18, 2012 at 6:12 PM, jfoug <> wrote:
> I am only looking at the cpu file  pwsafe_fmt.c    I question the algorithm.
> I recently added this to, and will list the function here, since
> it is easier to see than the C code:
> Notice the for (i=0; i<=iter; ++i)
> That will do 2049 sha256’s if iter is 2048.  I know this is the way the CPU
> versoin of the code is (at least), because I have created a TS file, and the
> CPU version detects it perfectly.   BUT is the hashing wrong?  Any time I
> see a for loop like this:  for (i = 0; i <= MAX; ++i)  I reaslly think long
> and hard about if it is right or not.

Yes, at first it does look like a typo.

> I went out to pwsafe site, and downloaded the code.  Here is the stretchkey
> function, directly from their source tree:
> NOTICE, for (I = 0; I < N; ++i)

After key stretching is done (ITER times), the result is hashed once
again later on in the actual code. Hence SHA256 runs ITER + 1 times
total (so the loop is actually correct). In my intitial code, I had
the final SHA256 separate  from the ITER loop. Solar, correctly
changed the loop to run ITER + 1 times and removed the final SHA256

> I do not think our version is proper.  Has anyone tested this against REAL
> hashes of known passwords, and not simply against self generated data???

pwsafe format has been tested with real .psafe3 files and it
successfully cracks them. No problems.

You can yourself verify this by downloading sample .psafe3 files from


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.