Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 12 Jun 2013 23:45:17 +0200
From: magnum <john.magnum@...hmail.com>
To: john-users@...ts.openwall.com
Subject: Resume for KDEPaste external mode

Solar, Michael, all,

KDEPaste lacks a restore() function. If you resume it, it will just restart from scratch. My first question is: Should this not be detected and resulting in refusal to resume? Or could some modes work fine without a resume() function? I guess some could... but at least we should warn or something?

Second, I tried to implement a restore() for it. As the only thing we know is the last generated word, I can't see any better way to do it than stupidly re-generating all candidates until that word is found. This will be very ineffective (bordering useless for fast hashes) but disregarding that, it doesn't work at all. Here's my current code, it hangs forever. Can anyone see why?

void restore()
{
	int i, rand_seed, rand_result;

	i = 0;

	/* Very crude restore, just dry-run until we hit last word */
	while (i != password_length) {

		while (endTime % msec != 0) {
			if (++msec > 999) {
				endTime--;
				msec = 1;
			}
		}

		rand_seed = endTime / msec;

		i = 0;
		while (i < password_length) {
			rand_seed = rand_seed * 1103515245 + 12345;
			rand_result = (rand_seed >> 16) & 2047;

			rand_seed = rand_seed * 1103515245 + 12345;
			rand_result <<= 10;
			rand_result ^= (rand_seed >> 16) & 1023;

			rand_seed = rand_seed * 1103515245 + 12345;
			rand_result <<= 10;
			rand_result ^= (rand_seed >> 16) & 1023;

			if (charset[rand_result % charset_length] != word[i])
				break;
		}

		if (++msec > 999) {
			endTime--;
			msec = 1;
		}
	}
}

magnum

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.