|
|
Message-ID: <CABtNtWF9VWRFKQOaKHDKGbNX-JhejZFiHhA5K57M4_W+UajaFg@mail.gmail.com>
Date: Mon, 17 Aug 2015 20:43:42 +0800
From: Kai Zhao <loverszhao@...il.com>
To: john-dev@...ts.openwall.com
Subject: Re: testing every index (Re: more robustness)
Hi Alexander,
On Mon, Aug 17, 2015 at 6:51 PM, Solar Designer <solar@...nwall.com> wrote:
> Hi Kai,
>
> On Mon, Aug 17, 2015 at 06:10:52PM +0800, Kai Zhao wrote:
>> I tried to implement this in the following patch:
>>
>> https://github.com/loverszhaokai/JohnTheRipper/commit/794f5ffa998b122e9457c566ee8860d456fe01af
>>
>> There is check_all_even_index() and check_all_odd_index().
>> I set the correct password to all the even index in check_all_even_index().
>>
>> for (i = 0; i < max; i++) {
>> if (i % 2 == 0)
>> key = plaintext;
>> else
>> key = longcand(format, i, ml);
>> fmt_set_key(key, i);
>> }
>>
>> And then check all the even index by cmp_one() in check_all_index()
>>
>> for (i = 0; i < max; i++)
>> if ((is_even && i % 2 == 0) ||
>> (!is_even && i % 2 == 1)) {
>> if (!format->methods.cmp_one(binary, i)) {
>> snprintf(err_buf, sizeof(err_buf), "cmp_one(%d) failed",
>> i);
>> return err_buf;
>> }
>> }
>>
>>
>> Does this what you mean by testing every index ?
>
> Also, it is preferable that you make use of all test vectors at once
> rather than use just one plaintext for all expected-correct indices.
>
What do you mean by "make use of all test vectors at once
rather than use just one plaintext for all expected-correct indices."
For example,
LM.fmt.c
static struct fmt_tests tests[] = {
{"$LM$a9c604d244c4e99d", "AAAAAA"},
{"$LM$cbc501a4d2227783", "AAAAAAA"},
{"$LM$3466c2b0487fe39a", "CRACKPO"},
{"$LM$dbc5e5cba8028091", "IMPUNIT"},
{LM_EMPTY LM_EMPTY, ""},
{"$LM$73cc402bd3e79175", "SCLEROS"},
{"$LM$5ecd9236d21095ce", "YOKOHAM"},
{"$LM$A5E6066DE61C3E35", "ZZZZZZZ"}, /* uppercase encoding */
{"$LM$1FB363feB834C12D", "ZZZZZZ"}, /* mixed case encoding */
{NULL}
};
Now we are cracking the "$LM$a9c604d244c4e99d", and the correct
password is "AAAAAA".
The current array of keys which set correct passwords on the even
index is:
[0] = "AAAAAA"
[1] = "wrong password"
[2] = "AAAAAA"
[3] = "wrong password"
...
To make use of all the test vectors, do you mean the array should be
the following ?
[0] = "AAAAAA"
[1] = "AAAAAAA"
[2] = "CRACKPO"
[3] = "IMPUNIT"
...
Thanks,
Kai
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.