/*
* This file is part of John the Ripper password cracker,
* Copyright (c) 1996-2001,2005 by Solar Designer
*/
#include <string.h>
#include "arch.h"
#include "common.h"
#include "DES_std.h"
#if ARCH_BITS >= 64
#if !DES_ASM
static union {
double dummy;
struct {
DES_KS KS;
ARCH_WORD SPE_F[8][64];
#if DES_128K
ARCH_WORD SPE_W[4][64 * 64];
#endif
} data;
} CC_CACHE_ALIGN DES_all;
#else
extern ARCH_WORD DES_SPE_F[8][64];
#if DES_128K
extern ARCH_WORD DES_SPE_W[4][64 * 64];
#endif
#endif
static ARCH_WORD DES_SPE[8][64];
#else
#if !DES_ASM
static union {
double dummy;
struct {
DES_KS KS;
ARCH_WORD SPE_L[8][64];
ARCH_WORD cache_bank_shift;
ARCH_WORD SPE_H[8][64];
#if DES_128K
ARCH_WORD restore_double_word_alignment;
ARCH_WORD SPE_W[4][64 * 64][2];
#endif
} data;
} CC_CACHE_ALIGN DES_all;
#else
#if DES_X2
extern ARCH_WORD DES_SPE_F[8][64][2];
#else
extern ARCH_WORD DES_SPE_L[8][64], DES_SPE_H[8][64];
#endif
#if DES_128K
extern ARCH_WORD DES_SPE_W[4][64 * 64][2];
#endif
#endif
static ARCH_WORD DES_SPE[8][64][2];
#endif
#if !DES_ASM
#define DES_KS_copy DES_all.data.KS
#define DES_SPE_F DES_all.data.SPE_F
#define DES_SPE_L DES_all.data.SPE_L
#define DES_SPE_H DES_all.data.SPE_H
#define DES_SPE_W DES_all.data.SPE_W
DES_binary DES_IV;
ARCH_WORD DES_count;
DES_KS CC_CACHE_ALIGN DES_KS_current;
DES_KS CC_CACHE_ALIGN DES_KS_table[8][128];
#endif
static int DES_KS_updates;
static char DES_key[16];
#if DES_COPY
#if DES_ASM
extern DES_KS DES_KS_copy;
#endif
unsigned ARCH_WORD *DES_out;
#endif
extern DES_KS DES_KS_table[8][128];
#if ARCH_BITS >= 64
static ARCH_WORD DES_IP_E[8][16], DES_C_FP[16][16];
#else
static ARCH_WORD DES_IP_E[8][16][2], DES_C_FP[16][16][2];
#endif
/*
* Some architecture-dependent definitions follow. Be sure to use correct
* options while compiling, this might affect the performance a lot.
*/
#if (ARCH_BITS >= 64 && (DES_SCALE || !DES_MASK) || DES_128K) && \
DES_SIZE_FIX == 2
/*
* 64-bit architectures which can shift addresses left by 1 bit with no extra
* time required (for example by adding a register to itself).
*/
#define DES_INDEX(SPE, i) \
(*((ARCH_WORD *)(((unsigned char (*)[2])SPE) + (i))))
#else
#if DES_SIZE_FIX == 0
/*
* 64-bit architectures which can shift addresses left by 3 bits (but maybe
* not by 1) with no extra time required (for example by using the S8ADDQ
* instruction on DEC Alphas; we would need an ADDQ anyway).
*/
#define DES_INDEX(SPE, i) \
SPE[i]
#else
/*
* Architectures with no complicated addressing modes supported, or when those
* are not required.
*/
#define DES_INDEX(SPE, i) \
(*((ARCH_WORD *)(((unsigned char *)SPE) + (i))))
#if ARCH_BITS < 64 && DES_128K
#define DES_INDEX_L(SPE, i) \
(*((ARCH_WORD *)(((unsigned char *)&SPE[0][0]) + (i))))
#define DES_INDEX_H(SPE, i) \
(*((ARCH_WORD *)(((unsigned char *)&SPE[0][1]) + (i))))
#endif
#endif
#endif
/*
* You can choose between using shifts/masks, and using memory store and load
* instructions.
*/
#if DES_MASK
#if ARCH_BITS >= 64 && !DES_SCALE && DES_SIZE_FIX == 2
/*
* This method might be good for some 64-bit architectures with no complicated
* addressing modes supported. It would be the best one for DEC Alphas if they
* didn't have the S8ADDQ instruction.
*/
#define DES_MASK_6 (0x3F << 3)
#else
#if DES_EXTB
/*
* Masking whole bytes allows the compiler to use Move with Zero Extension
* instructions (where supported), like MOVZBL (MOVZX in Intel's syntax) on
* x86s, or EXTBL on DEC Alphas. It might only be reasonable to disable this
* if such instructions exist, but are slower than masks/shifts (as they are
* on Pentiums).
*/
#define DES_MASK_6 ((0x3F << DES_SIZE_FIX) | 0xFF)
#else
/*
* Forces using plain shifts/masks, sometimes it's the only choice. Note that
* you don't have to set DES_MASK if this is the case -- store/load method
* might be faster.
*/
#define DES_MASK_6 (0x3F << DES_SIZE_FIX)
#endif
#endif
#endif
#if !DES_COPY
#undef DES_KS_copy
#define DES_KS_copy KS
#endif
#define DES_KS_INDEX(i) (DES_KS_copy + (i * (16 / DES_SIZE)))
#define DES_24_TO_32(x) \
(((x) & 077) | \
(((x) & 07700) << 2) | \
(((x) & 0770000) << 4) | \
(((x) & 077000000) << 6))
#define DES_16_TO_32(x) \
((((x) & 0xF) << 1) | \
(((x) & 0xF0) << 5) | \
(((x) & 0xF00) << 9) | \
(((x) & 0xF000) << 13))
#if DES_128K
#define DES_UNDO_SIZE_FIX(x) \
((((x) >> 1) & 0xFF00FF00) | (((x) & 0x00FF00FF) >> 3))
#else
#define DES_UNDO_SIZE_FIX(x) \
((x) >> DES_SIZE_FIX)
#endif
static unsigned char DES_S[8][4][16] = {
{
{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7},
{0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8},
{4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0},
{15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13}
}, {
{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10},
{3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5},
{0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15},
{13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9}
}, {
{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8},
{13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1},
{13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7},
{1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12}
}, {
{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15},
{13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9},
{10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4},
{3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14}
}, {
{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9},
{14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6},
{4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14},
{11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3}
}, {
{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11},
{10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8},
{9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6},
{4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13}
}, {
{4, 11, 2, 14, 15, 0, 8, 13, 3, 12, 9, 7, 5, 10, 6, 1},
{13, 0, 11, 7, 4, 9, 1, 10, 14, 3, 5, 12, 2, 15, 8, 6},
{1, 4, 11, 13, 12, 3, 7, 14, 10, 15, 6, 8, 0, 5, 9, 2},
{6, 11, 13, 8, 1, 4, 10, 7, 9, 5, 0, 15, 14, 2, 3, 12}
}, {
{13, 2, 8, 4, 6, 15, 11, 1, 10, 9, 3, 14, 5, 0, 12, 7},
{1, 15, 13, 8, 10, 3, 7, 4, 12, 5, 6, 11, 0, 14, 9, 2},
{7, 11, 4, 1, 9, 12, 14, 2, 0, 6, 10, 13, 15, 3, 5, 8},
{2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11}
}
};
static unsigned char DES_P[32] = {
15, 6, 19, 20,
28, 11, 27, 16,
0, 14, 22, 25,
4, 17, 30, 9,
1, 7, 23, 13,
31, 26, 2, 8,
18, 12, 29, 5,
21, 10, 3, 24
};
unsigned char DES_E[48] = {
31, 0, 1, 2, 3, 4,
3, 4, 5, 6, 7, 8,
7, 8, 9, 10, 11, 12,
11, 12, 13, 14, 15, 16,
15, 16, 17, 18, 19, 20,
19, 20, 21, 22, 23, 24,
23, 24, 25, 26, 27, 28,
27, 28, 29, 30, 31, 0
};
static unsigned char DES_IP[64] = {
57, 49, 41, 33, 25, 17, 9, 1,
59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5,
63, 55, 47, 39, 31, 23, 15, 7,
56, 48, 40, 32, 24, 16, 8, 0,
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6
};
static unsigned char DES_C[64] = {
0, 1, 2, 3, 16, 17, 18, 19,
4, 5, 6, 7, 20, 21, 22, 23,
8, 9, 10, 11, 24, 25, 26, 27,
12, 13, 14, 15, 28, 29, 30, 31,
32, 33, 34, 35, 48, 49, 50, 51,
36, 37, 38, 39, 52, 53, 54, 55,
40, 41, 42, 43, 56, 57, 58, 59,
44, 45, 46, 47, 60, 61, 62, 63
};
unsigned char DES_PC1[56] = {
56, 48, 40, 32, 24, 16, 8,
0, 57, 49, 41, 33, 25, 17,
9, 1, 58, 50, 42, 34, 26,
18, 10, 2, 59, 51, 43, 35,
62, 54, 46, 38, 30, 22, 14,
6, 61, 53, 45, 37, 29, 21,
13, 5, 60, 52, 44, 36, 28,
20, 12, 4, 27, 19, 11, 3
};
unsigned char DES_ROT[16] = {
1, 1, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 2, 2, 1
};
unsigned char DES_PC2[48] = {
13, 16, 10, 23, 0, 4,
2, 27, 14, 5, 20, 9,
22, 18, 11, 3, 25, 7,
15, 6, 26, 19, 12, 1,
40, 51, 30, 36, 46, 54,
29, 39, 50, 44, 32, 47,
43, 48, 38, 55, 33, 52,
45, 41, 49, 35, 28, 31
};
static v
没有合适的资源?快使用搜索试试~ 我知道了~
john-the-ripper
共190个文件
c:53个
h:52个
o:46个
3星 · 超过75%的资源 需积分: 50 75 下载量 162 浏览量
2010-07-02
18:42:47
上传
评论 1
收藏 1.72MB ZIP 举报
温馨提示
john-the-ripper 密码破解工具 本人测试过:4位字母和数字组合 大概5分钟不到破译 PS:影响破译速度的最重要因素是 硬件性能
资源推荐
资源详情
资源评论
收起资源包目录
john-the-ripper (190个子文件)
john.asm 2KB
john-1.7.3.4.tar.bz2 642KB
DES_std.c 27KB
MD5_std.c 27KB
compiler.c 26KB
BF_std.c 26KB
loader.c 16KB
inc.c 14KB
rules.c 14KB
DES_bs_b.c 13KB
sboxes.c 13KB
charset.c 12KB
DES_bs_s.c 12KB
ppc-alti.c 12KB
nonstd.c 12KB
DES_bs_n.c 11KB
DES_bs.c 10KB
AFS_fmt.c 10KB
single.c 8KB
john.c 8KB
BSDI_fmt.c 7KB
bench.c 6KB
cracker.c 6KB
DES_fmt.c 6KB
options.c 6KB
signals.c 6KB
recovery.c 5KB
logger.c 5KB
wordlist.c 5KB
config.c 5KB
status.c 4KB
unique.c 4KB
LM_fmt.c 4KB
BF_fmt.c 4KB
external.c 3KB
MD5_fmt.c 3KB
getopt.c 3KB
formats.c 3KB
unshadow.c 3KB
detect.c 3KB
rpp.c 2KB
path.c 2KB
misc.c 2KB
math.c 2KB
idle.c 2KB
tty.c 2KB
unafs.c 2KB
best.c 1KB
memory.c 1KB
list.c 1KB
crc32.c 1KB
batch.c 1KB
common.c 880B
symlink.c 513B
params.c 355B
CHANGES 4KB
all.chr 333KB
alnum.chr 227KB
lanman.chr 211KB
alpha.chr 128KB
digits.chr 39KB
john.com 387B
john.conf 20KB
CONFIG 5KB
CONTACT 1KB
CREDITS 2KB
Makefile.dep 0B
EXAMPLES 15KB
EXTERNAL 3KB
FAQ 12KB
test.file 58B
params.h 7KB
formats.h 6KB
loader.h 5KB
DES_std.h 4KB
DES_bs.h 4KB
options.h 3KB
getopt.h 2KB
rules.h 2KB
MD5_std.h 2KB
charset.h 2KB
config.h 2KB
memory.h 2KB
misc.h 1KB
sparc32.h 1KB
status.h 1KB
compiler.h 1KB
bench.h 1KB
cracker.h 1KB
recovery.h 1KB
BF_std.h 1KB
rpp.h 1KB
x86-sse.h 1KB
x86-mmx.h 1KB
list.h 1KB
signals.h 1KB
logger.h 1KB
x86-any.h 1KB
ppc64alt.h 1017B
ppc32alt.h 1016B
共 190 条
- 1
- 2
「已注销」
- 粉丝: 8
- 资源: 38
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页