2 * rcracki_mt is a multithreaded implementation and fork of the original
\r
5 * Copyright (C) Zhu Shuanglei <shuanglei@hotmail.com>
\r
6 * Copyright Martin Westergaard Jørgensen <martinwj2005@gmail.com>
\r
7 * Copyright 2009, 2010 Daniël Niggebrugge <niggebrugge@fox-it.com>
\r
8 * Copyright 2009, 2010, 2011 James Nobis <frt@quelrod.net>
\r
10 * This file is part of rcracki_mt.
\r
12 * rcracki_mt is free software: you can redistribute it and/or modify
\r
13 * it under the terms of the GNU General Public License as published by
\r
14 * the Free Software Foundation, either version 2 of the License, or
\r
15 * (at your option) any later version.
\r
17 * rcracki_mt is distributed in the hope that it will be useful,
\r
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
20 * GNU General Public License for more details.
\r
22 * You should have received a copy of the GNU General Public License
\r
23 * along with rcracki_mt. If not, see <http://www.gnu.org/licenses/>.
\r
26 #if defined(_WIN32) && !defined(__GNUC__)
\r
27 #pragma warning(disable : 4786)
\r
30 #include "HashRoutine.h"
\r
31 #include "HashAlgorithm.h"
\r
33 //////////////////////////////////////////////////////////////////////
\r
35 CHashRoutine::CHashRoutine()
\r
37 // Notice: MIN_HASH_LEN <= nHashLen <= MAX_HASH_LEN
\r
40 AddHashRoutine("lm", HashLM, 8);
\r
41 AddHashRoutine("ntlm", HashNTLM, 16);
\r
42 // AddHashRoutine("md2", HashMD2, 16);
\r
43 AddHashRoutine("md4", HashMD4, 16);
\r
44 AddHashRoutine("md5", HashMD5, 16);
\r
45 AddHashRoutine("doublemd5", HashDoubleMD5, 16);
\r
46 AddHashRoutine("sha1", HashSHA1, 20);
\r
47 // AddHashRoutine("ripemd160", HashRIPEMD160, 20);
\r
48 AddHashRoutine("mysql323", HashMySQL323, 8);
\r
49 AddHashRoutine("mysqlsha1", HashMySQLSHA1, 20);
\r
50 AddHashRoutine("ciscopix", HashPIX, 16);
\r
51 AddHashRoutine("mscache", HashMSCACHE, 16);
\r
52 AddHashRoutine("halflmchall", HashHALFLMCHALL, 8);
\r
55 AddHashRoutine("lmchall", HashLMCHALL, 24);
\r
56 AddHashRoutine("ntlmchall", HashNTLMCHALL, 24);
\r
57 AddHashRoutine("oracle", HashORACLE, 8);
\r
60 CHashRoutine::~CHashRoutine()
\r
64 void CHashRoutine::AddHashRoutine(string sHashRoutineName, HASHROUTINE pHashRoutine, int nHashLen)
\r
66 vHashRoutineName.push_back(sHashRoutineName);
\r
67 vHashRoutine.push_back(pHashRoutine);
\r
68 vHashLen.push_back(nHashLen);
\r
71 string CHashRoutine::GetAllHashRoutineName()
\r
75 for (i = 0; i < vHashRoutineName.size(); i++)
\r
76 sRet += vHashRoutineName[i] + " ";
\r
81 void CHashRoutine::GetHashRoutine(string sHashRoutineName, HASHROUTINE& pHashRoutine, int& nHashLen)
\r
84 for (i = 0; i < vHashRoutineName.size(); i++)
\r
86 if (sHashRoutineName == vHashRoutineName[i])
\r
88 pHashRoutine = vHashRoutine[i];
\r
89 nHashLen = vHashLen[i];
\r
94 pHashRoutine = NULL;
\r