Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

RainbowCrack tripcode patch

Name: !hT7zRmFpyY 2008-02-15 7:15


diff -rubB rainbowcrack-1.2-src/src/HashAlgorithm.cpp rainbowcrack+tripcodes/src/HashAlgorithm.cpp
--- rainbowcrack-1.2-src/src/HashAlgorithm.cpp    2003-11-23 00:33:22.000000000 -0500
+++ rainbowcrack+tripcodes/src/HashAlgorithm.cpp    2008-01-14 16:48:59.000000000 -0500
@@ -57,3 +57,58 @@
 {
     SHA1(pPlain, nPlainLen, pHash);
 }
+
+char _s(char c)
+{
+    switch (c) {
+        case ':': return 'A';
+        case ';': return 'B';
+        case '=': return 'D';
+        case '?': return 'F';
+        case '@': return 'G';
+        case '[': return 'a';
+        case '\\':return 'b';
+        case ']': return 'c';
+        case '^': return 'd';
+        case '_': return 'e';
+        case '`': return 'f';
+        case ('/')...('9'):
+        case ('A')...('Z'):
+        case ('a')...('z'):
+            return c;
+        default:
+            return '.';
+    }
+}
+
+#include <string.h>
+void HashTrip(unsigned char* pPlain, int nPlainLen, unsigned char* pHash)
+{
+    // should be long enough for 6 chars overflow ("&quot;") plus 3 more
+    // in the salt for the H.. at the end.
+    char pw[16], salt[16];
+    // raw DES output
+    char output[16];
+    int n, p;
+
+    if (nPlainLen > 8)
+        nPlainLen = 8; // ignore the rest
+    for (n = 0, p = 0; n < nPlainLen && p <= 8; n++) {
+        char c = pPlain[n];
+        switch (c) {
+            case '"': strcat(pw, "&quot;"); p += 6; break;
+            case '\'':strcat(pw, "'" ); p += 5; break;
+            case '<': strcat(pw, "&lt;"  ); p += 4; break;
+            case '>': strcat(pw, "&gt;"  ); p += 4; break;
+            case ',': strcat(pw, "," ); p += 5; break;
+            default:  pw[p++] = c;
+        }
+    }
+    pw[p++] = 0;
+    strcpy(salt, pw);
+    strcat(salt, "H.");
+    salt[1] = _s(salt[1]);
+    salt[2] = _s(salt[2]);
+    DES_fcrypt(pw, salt + 1, output);
+    strcpy((char *) pHash, output + 3);
+}
diff -rubB rainbowcrack-1.2-src/src/HashAlgorithm.h rainbowcrack+tripcodes/src/HashAlgorithm.h
--- rainbowcrack-1.2-src/src/HashAlgorithm.h    2003-11-23 00:33:18.000000000 -0500
+++ rainbowcrack+tripcodes/src/HashAlgorithm.h    2008-01-14 15:48:55.000000000 -0500
@@ -10,5 +10,6 @@
 void HashLM(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
 void HashMD5(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
 void HashSHA1(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
+void HashTrip(unsigned char* pPlain, int nPlainLen, unsigned char* pHash);
 
 #endif
diff -rubB rainbowcrack-1.2-src/src/HashRoutine.cpp rainbowcrack+tripcodes/src/HashRoutine.cpp
--- rainbowcrack-1.2-src/src/HashRoutine.cpp    2003-11-23 00:33:16.000000000 -0500
+++ rainbowcrack+tripcodes/src/HashRoutine.cpp    2008-01-14 15:48:28.000000000 -0500
@@ -20,6 +20,7 @@
     AddHashRoutine("lm",   HashLM,   8);
     AddHashRoutine("md5",  HashMD5,  16);
     AddHashRoutine("sha1", HashSHA1, 20);
+    AddHashRoutine("trip", HashTrip, 10);
 }
 
 CHashRoutine::~CHashRoutine()

Name: Anonymous 2008-02-16 10:23

what range of characters is valid in tripcode input?
Really, [\001-\377]. DES is only 7-bit, but remember there are side effects of using high-bit characters in the second and third positions because they potentially affect the salt used.

what range have you actually used in your rainbow table, and how much space does it take?
I'm using about 400 GB for tables. This includes all 0-4 character tripcodes, all 5-character [A-Za-z0-9./], and an assortment of a bunch of other tables that don't really go together. e.g. I started doing all 5 and 6 characters, but calculated how much it would take for all of them and realized I don't have the disk space (or enough CPUs to do it in an even remotely decent length of time) so I just made some of the tables for 6-8 characters. So really, I could do a lot better but it'd take much greater resources.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List