Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 12 Oct 2007 11:03:43 +0200
From: Francesco Minafra <Francesco.Minafra@...infn.it>
To:  john-users@...ts.openwall.com
Subject: List.External:Parallel section in the example john.conf

Hi all,
  I have a question concerning the method used in the
default john.conf to achieve some kind of parallelism between
nodes/processors.

  I see that the section [List.External:Parallel]
has pseudo-c code that causes the "current" node analyze
only words with indexes given by the "modulo" computation.
  As I am not so good at figuring-out how algorithms work
"on the fly", I have reproduced the behavior of the filter()
function in a small perl program:

#!/usr/bin/perl -W
my $total = 4;
my $end = 20;
my $prev = 0;
my $res = 0;
for (my $node = 1; $node < 5; $node++) {
  my $number = $node - 1;
  print "We are on node $node\n";
  print "Initial value for number is: $number\n";
  while ($number < $end) {
    if ($number++ % $total) {
      $prev = $number - 1;
      $res = $prev % $total;
      print "$prev modulo $total = $res\n";
    } else {
      $prev = $number - 1;
      print "Number is now: $prev\n";
    }
  }
}


Please correct me if I am wrong, but I see from the output that there is
an overlap on the keyspace assigned to each node.

This can be prevented by introducing a suitable "offset":

#!/usr/bin/perl -W
my $total = 4;
my $end = 20;
my $prev = 0;
my $res = 0;
for (my $node = 1; $node < 5; $node++) {
  my $number = $node - 1;
  my $offset = $number;
  print "We are on node $node\n";
  print "Initial value for number is: $number\n";
  while ($number < $end) {
    if (($number++ % $total) - $offset) {
      $prev = $number - 1;
      $res = $prev % $total;
      print "$prev modulo $total = $res\n";
    } else {
      $prev = $number - 1;
      print "Number is now: $prev\n";
    }
  }
}

and in the john.conf I used the following (e.g. for the fifth node):

int node, total;                        // This node's number, and node
count
int number, offset;                             // Current word number

void init()
{
        node = 5; total = 12;           // Node 5 of 12, change as
appropriate
        number = node - 1;              // Speedup the filter a bit
        offset = number;                // Actually we need an offset to
cover the entire
                                              // keyspace with all the nodes
}

void filter()
{
        if ((number++ % total) - offset)        // Word for a different
node?
                word = 0;                       // Yes, skip it
}


Sorry if this topic has already been discussed, and/or has wrong
arguments. If so, please don't consider this post :)

Ciao.

-- 
To unsubscribe, e-mail john-users-unsubscribe@...ts.openwall.com and reply
to the automated confirmation request that will be sent to you.

Powered by blists - more mailing lists

Your e-mail address:

Powered by Openwall GNU/*/Linux - Powered by OpenVZ