2 RainbowCrack - a general propose implementation of Philippe Oechslin's faster time-memory trade-off technique.
4 Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
8 #pragma warning(disable : 4786)
11 #include "HashRoutine.h"
12 #include "HashAlgorithm.h"
14 //////////////////////////////////////////////////////////////////////
16 CHashRoutine::CHashRoutine()
18 // Notice: MIN_HASH_LEN <= nHashLen <= MAX_HASH_LEN
21 AddHashRoutine("lm", HashLM, 8);
22 AddHashRoutine("ntlm", HashNTLM, 16);
23 // AddHashRoutine("md2", HashMD2, 16);
24 AddHashRoutine("md4", HashMD4, 16);
25 AddHashRoutine("md5", HashMD5, 16);
26 AddHashRoutine("doublemd5", HashDoubleMD5, 16);
27 /* AddHashRoutine("sha1", HashSHA1, 20);
28 AddHashRoutine("ripemd160", HashRIPEMD160, 20);
29 AddHashRoutine("mysql323", HashMySQL323, 8);
30 AddHashRoutine("mysqlsha1", HashMySQLSHA1, 20);
31 AddHashRoutine("ciscopix", HashPIX, 16);*/
32 // AddHashRoutine("mscache", HashMSCACHE, 16);
33 AddHashRoutine("halflmchall", HashHALFLMCHALL, 8);
36 AddHashRoutine("lmchall", HashLMCHALL, 24);
37 AddHashRoutine("ntlmchall", HashNTLMCHALL, 24);
38 // AddHashRoutine("oracle", HashORACLE, 8);
42 CHashRoutine::~CHashRoutine()
46 void CHashRoutine::AddHashRoutine(string sHashRoutineName, HASHROUTINE pHashRoutine, int nHashLen)
48 vHashRoutineName.push_back(sHashRoutineName);
49 vHashRoutine.push_back(pHashRoutine);
50 vHashLen.push_back(nHashLen);
53 string CHashRoutine::GetAllHashRoutineName()
57 for (i = 0; i < vHashRoutineName.size(); i++)
58 sRet += vHashRoutineName[i] + " ";
63 void CHashRoutine::GetHashRoutine(string sHashRoutineName, HASHROUTINE& pHashRoutine, int& nHashLen)
66 for (i = 0; i < vHashRoutineName.size(); i++)
68 if (sHashRoutineName == vHashRoutineName[i])
70 pHashRoutine = vHashRoutine[i];
71 nHashLen = vHashLen[i];