diff -urpN jumbo-unstable1/run/john.conf jumbo-unstable/run/john.conf --- jumbo-unstable1/run/john.conf 2012-04-13 11:20:17.234375000 -0500 +++ jumbo-unstable/run/john.conf 2012-04-13 11:28:19.125000000 -0500 @@ -550,8 +550,19 @@ void restore() /* make this 'long' enough for other externs that include this one */ /* (up to 14 bytes long) We currently have double and double10 defined, */ /* but could add more, up to double14 */ + int length, current[15], max; +/* this new 'type' variable, is used to tell double what character set to + * use. It can use the original (alpha). If type is 0 (i.e. unset), then + * a-z (alpha) character set is used. If type is '0' (a zero ascii byte) + * then alnum charset is used, a-z0-9. If type is a space char, then all + * charset is used [space - tilde] or [ -~]. This required setting the + * type var in the init() of alnum or all doubles (it can be left unset + * in the alpha versions). It also requires some if logic in generate. + * other than that, it works the same, with almost no performance hit */ +int type; + /* Generates a new word */ void generate() { @@ -564,19 +575,48 @@ void generate() /* Generate a new word */ i = length - 1; // Start from the last character - while (++current[i] > 'z') // Try to increase it - if (i) // Overflow here, any more positions? - current[i--] = 'a'; // Yes, move to the left, and repeat - else { // No - current = 0; // Request a length switch - break; // Break out of the loop + if (type == 0) { + /* alpha */ + while (++current[i] > 'z') // Try to increase it + if (i) // Overflow here, any more positions? + current[i--] = 'a'; // Yes, move to the left, and repeat + else { // No + current = 0; // Request a length switch + break; // Break out of the loop + } + } else if (type == '0') { + /* alnum */ + if (current[i] == 'z') current[i] = '0'-1; + while (++current[i] == '9') { // Try to increase it + if (i) // Overflow here, any more positions? + current[i--] = 'a'; // Yes, move to the left, and repeat + else { // No + current = 0; // Request a length switch + break; // Break out of the loop + } + if (current[i] == 'z') current[i] = '0'-1; + } + } else if (type == ' ') { + /* all */ + while (++current[i] > '~') { // Try to increase it + if (i) // Overflow here, any more positions? + current[i--] = ' '; // Yes, move to the left, and repeat + else { // No + current = 0; // Request a length switch + break; // Break out of the loop + } + } } + /* else ????? wtf?? */ /* Switch to the next length, unless we were generating 8 character long * words already. */ if (!current && length < max) { i = ++length; - while (i--) current[i] = 'a'; + if (type == 0 || type == '0') + while (i--) current[i] = 'a'; + else if (type == ' ') + while (i--) current[i] = ' '; } } @@ -606,6 +646,34 @@ void init() max = 4; } +[List.External:Double_alnum] +.include [List.External_base:Double] + +/* Called at startup to initialize the global variables */ +void init() +{ + int i; + + i = length = 2; // Start with 4 character long words + while (i--) current[i] = 'a'; // Set our half-word to "aa" + max = 4; + + type = '0'; +} + +[List.External:Double_all] +.include [List.External_base:Double] +void init() +{ + int i; + + i = length = 2; // Start with 4 character long words + while (i--) current[i] = ' '; // Set our half-word to " " + max = 4; + + type = ' '; +} + [List.External:Double10] .include [List.External_base:Double] @@ -619,6 +687,19 @@ void init() max = 5; } +[List.External:Double10_alnum] +.include [List.External_base:Double] +void init() +{ + int i; + + i = length = 5; // Start with 4 character long words + while (i--) current[i] = 'a'; // Set our half-word to "aa" + max = 5; + + type = '0'; +} + # Strip 0.5 ("Secure Tool for Recalling Important Passwords") cracker, # based on analysis done by Thomas Roessler and Ian Goldberg. This will # crack passwords you may have generated with Strip; other uses of Strip