[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Sat, 06 Mar 2010 14:07:36 +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:
> In case anyone share my curiousity, I enclose a little patch making it
> easy to choose which format is tested/benchmarked, as a compile time
> option. It's supposed to be applied after the crypt-1 patch.
Sorry about that, I incorrectly used a minus sign messing SHA tests up.
I'm not a coder really. Here is a fixed patch. It also adds some
dupe-salt checking code that seemed to be missing, in the unlikely case
there are duplicates.
Now SHA-512 is faster than SHA-256, that was a bit unintuitive to me.
---8<---------8<---------8<---------8<---------8<------
Benchmarking: Traditional DES [128/128 BS SSE2-16]... DONE
Many salts: 4504K c/s real, 4563K c/s virtual
Only one salt: 3884K c/s real, 3884K c/s virtual
Benchmarking: generic crypt(3) native (using DES) [OS/64]... DONE
Many salts: 421162 c/s real, 425416 c/s virtual
Only one salt: 417396 c/s real, 417396 c/s virtual
Benchmarking: FreeBSD MD5 [32/64 X2]... DONE
Raw: 20248 c/s real, 20640 c/s virtual
Benchmarking: generic crypt(3) native (using MD5) [OS/64]... DONE
Many salts: 8061 c/s real, 8118 c/s virtual
Only one salt: 8087 c/s real, 8087 c/s virtual
Benchmarking: generic crypt(3) native (using SHA-256) [OS/64]... DONE
Many salts: 382 c/s real, 388 c/s virtual
Only one salt: 397 c/s real, 398 c/s virtual
Benchmarking: generic crypt(3) native (using SHA-512) [OS/64]... DONE
Many salts: 464 c/s real, 465 c/s virtual
Only one salt: 465 c/s real, 466 c/s virtual
---8<---------8<---------8<---------8<---------8<------
diff --git a/src/crypt_fmt.c b/src/crypt_fmt.c
index b272f43..0522bd9 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 " native (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}
};
@@ -90,6 +115,20 @@ static void *salt(char *ciphertext)
case 60:
if (!strncmp(ciphertext, "$2a$", 4)) cut = 29;
break;
+
+ case 63:
+ if (!strncmp(ciphertext, "$5$", 3)) {
+ char *p = strchr(ciphertext + 3, '$');
+ if (p) cut = p - ciphertext;
+ }
+ break;
+
+ case 106:
+ 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