Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 10 Jun 2013 09:12:48 +1000
From: Michael Samuel <mik@...net.net>
To: john-users@...ts.openwall.com
Subject: Re: Extra functions/datatypes for external mode?

On 10 June 2013 02:39, Solar Designer <solar@...nwall.com> wrote:

> Can you post the relevant excerpt from your C code (along with the
> relevant variable declarations)?  Did the original password generator
> use the "double" data type too?
>
> The original used the dot-net System.Random library, which expands the
entropy out
with this trick:

int32_t Random_Sample(random_state_t* state);

double Random_NextDouble(random_state_t* state)
{
        return ((double)Random_Sample(state)) * 4.6566128752457969E-10; /*
Reciprocal of 2^31 */
}

int Random_NextInt(random_state_t* state, int maxValue)
{
        assert(maxValue >= 0);
        return (int)(Random_NextDouble(state) * (double)maxValue);
}

I think that in your case it'd be best to go with emulating the one
> conversion via "double" in 32-bit integer arithmetic in an external
> mode, if having to implement that conversion is not easily avoidable.
>

I have code now that works well with john --stdin - so I guess I'm happy to
leave it at that.  Also, since I'm only asking for random integers of sizes
4, 10, 26 and 32 - I could just make a table of answers.

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.