[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Sun, 07 Mar 2010 02:25:18 +0100
From: "Magnum, P.I." <rawsmooth@...dband.net>
To: john-users@...ts.openwall.com
Subject: Re: Feedback on the generic crypt(3) patch
Magnum, P.I. skrev:
>> It also adds some dupe-salt checking code that seemed to be missing,
>> in the unlikely case there are duplicates.
>
> Hm, some tests reveal that it still doesn't recognize duplicate salts.
> It probably doesn't make much sense anyway as the system call won't take
> benefit from duplicate salts. Still, I'd like the output of "Loaded x
> password hashes with y different salts" to come out right. What did I miss?
>
Sorry again for the spamming, I really thought I got it right but I got
the lengths wrong despite what I thought were valid double-checks. I
enclose a fixed fix of the fix. Like before, this patch can be applied
after Solar's "john-1.7.3.1-generic-crypt-1.diff.gz"
Another strange thing though. I made up a password file of 1000 entries
using the same salt. SHA-256 performs at ~275000 c/s and SHA-512 at
119000 c/s. The benchmarks report figures (for "same salt" too) in order
of 1/1000 of that. When I test the same using different salts, it
performs at about the speed as reported by the benchmark. This tells me
there is actually a benefit of duplicate salts which is a surprise in
itself, and why isn't the benchmark reflecting this?
diff --git a/src/crypt_fmt.c b/src/crypt_fmt.c
index b272f43..f868fbe 100644
--- a/src/crypt_fmt.c
+++ b/src/crypt_fmt.c
@@ -10,9 +10,11 @@
#define FORMAT_LABEL "crypt"
#define FORMAT_NAME "generic crypt(3)"
-#define ALGORITHM_NAME "?/" ARCH_BITS_STR
+#define ALGORITHM_NAME "OS/" ARCH_BITS_STR
-#define BENCHMARK_COMMENT ""
+// Change the below to define the format you want to use when benchmarking
+#define TEST_SHA512
+#define BENCHMARK_COMMENT " (using SHA-512)"
#define BENCHMARK_LENGTH 0
#define PLAINTEXT_LENGTH 72
@@ -24,11 +26,34 @@
#define MAX_KEYS_PER_CRYPT 1
static struct fmt_tests tests[] = {
+#ifdef TEST_DES
{"CCNf8Sbh3HDfQ", "U*U*U*U*"},
{"CCX.K.MFy4Ois", "U*U***U"},
{"CC4rMpbg9AMZ.", "U*U***U*"},
{"XXxzOu6maQKqQ", "*U*U*U*U"},
{"SDbsugeBiC58A", ""},
+#endif
+#ifdef TEST_MD5
+ {"$1$dXc3I7Rw$ctlgjDdWJLMT.qwHsWhXR1", "U*U*U*U*"},
+ {"$1$dXc3I7Rw$94JPyQc/eAgQ3MFMCoMF.0", "U*U***U"},
+ {"$1$dXc3I7Rw$is1mVIAEtAhIzSdfn5JOO0", "U*U***U*"},
+ {"$1$eQT9Hwbt$XtuElNJD.eW5MN5UCWyTQ0", "*U*U*U*U"},
+ {"$1$Eu.GHtia$CFkL/nE1BYTlEPiVx1VWX0", ""},
+#endif
+#ifdef TEST_SHA256
+ {"$5$LKO/Ute40T3FNF95$U0prpBQd4PloSGU0pnpM4z9wKn4vZ1.jsrzQfPqxph9", "U*U*U*U*"},
+ {"$5$LKO/Ute40T3FNF95$fdgfoJEBoMajNxCv3Ru9LyQ0xZgv0OBMQoq80LQ/Qd.", "U*U***U"},
+ {"$5$LKO/Ute40T3FNF95$8Ry82xGnnPI/6HtFYnvPBTYgOL23sdMXn8C29aO.x/A", "U*U***U*"},
+ {"$5$9mx1HkCz7G1xho50$O7V7YgleJKLUhcfk9pgzdh3RapEaWqMtEp9UUBAKIPA", "*U*U*U*U"},
+ {"$5$kc7lRD1fpYg0g.IP$d7CMTcEqJyTXyeq8hTdu/jB/I6DGkoo62NXbHIR7S43", ""},
+#endif
+#ifdef TEST_SHA512
+ {"$6$LKO/Ute40T3FNF95$6S/6T2YuOIHY0N3XpLKABJ3soYcXD9mB7uVbtEZDj/LNscVhZoZ9DEH.sBciDrMsHOWOoASbNLTypH/5X26gN0", "U*U*U*U*"},
+ {"$6$LKO/Ute40T3FNF95$wK80cNqkiAUzFuVGxW6eFe8J.fSVI65MD5yEm8EjYMaJuDrhwe5XXpHDJpwF/kY.afsUs1LlgQAaOapVNbggZ1", "U*U***U"},
+ {"$6$LKO/Ute40T3FNF95$YS81pp1uhOHTgKLhSMtQCr2cDiUiN03Ud3gyD4ameviK1Zqz.w3oXsMgO6LrqmIEcG3hiqaUqHi/WEE2zrZqa/", "U*U***U*"},
+ {"$6$OmBOuxFYBZCYAadG$WCckkSZok9xhp4U1shIZEV7CCVwQUwMVea7L3A77th6SaE9jOPupEMJB.z0vIWCDiN9WLh2m9Oszrj5G.gt330", "*U*U*U*U"},
+ {"$6$ojWH1AiTee9x1peC$QVEnTvRVlPRhcLQCk/HnHaZmlGAAjCfrAN0FtOsOnUk5K5Bn/9eLHHiRzrTzaIKjW9NTLNIBUCtNVOowWS2mN.", ""},
+#endif
{NULL}
};
@@ -87,9 +112,23 @@ static void *salt(char *ciphertext)
if (!strncmp(ciphertext, "$2$", 3)) cut = 28;
break;
+ case 55:
+ if (!strncmp(ciphertext, "$5$", 3)) {
+ char *p = strchr(ciphertext + 3, '$');
+ if (p) cut = p - ciphertext;
+ }
+ break;
+
case 60:
if (!strncmp(ciphertext, "$2a$", 4)) cut = 29;
break;
+
+ case 98:
+ if (!strncmp(ciphertext, "$6$", 3)) {
+ char *p = strchr(ciphertext + 3, '$');
+ if (p) cut = p - ciphertext;
+ }
+ break;
}
#endif
Powered by blists - more mailing lists
Powered by Openwall GNU/*/Linux -
Powered by OpenVZ