-
-
[未解决,已结帖] [求助]有加密前字符串后加密后字符串,有加密函数代码,能不能求出密匙 150.00雪花
-
发表于: 2021-10-1 20:38 6066
-
delphi 程序,测试程序打包发上来了,如果知道加密前字符串和加密后字符串求密匙,加密函数如下:
procedure OUTCode(indata:pByte; outdata:pByte;InKey:ansistring);
var
y,z,sum: DWORD;
Key: array[0..3] of DWORD;
n,nlen,i:integer;
temp_string:ansistring;
keybuf: array[0..15] of byte;
begin
fillchar(keybuf,16,0);
nlen := Length(InKey);
i := 0;
n:=1;
while n < nlen do
begin
temp_string :=MidStr(InKey, n,2);
keybuf[i] := HexToInt(temp_string);
i := i + 1;
n:=n+2;
end;
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | for n: = 0 to 3 do begin Key[n]: = 0 ; end; for n: = 0 to 3 do begin Key[ 0 ] : = (keybuf[n] shl (n * 8 )) or Key[ 0 ]; Key[ 1 ] : = (keybuf[n + 4 ] shl (n * 8 )) or Key[ 1 ]; Key[ 2 ] : = (keybuf[n + 4 + 4 ] shl (n * 8 )) or Key[ 2 ]; Key[ 3 ] : = (keybuf[n + 4 + 4 + 4 ] shl (n * 8 )) or Key[ 3 ]; end; y : = 0 ; z : = 0 ; for n: = 0 to 3 do begin y : = (indata^ shl (n * 8 )) or y; inc(indata); end; for n: = 0 to 3 do begin z : = (indata^ shl (n * 8 )) or z; inc(indata); end; sum : = 0 ; for n: = 0 to 31 do begin inc( sum ,Delta); inc(y,((z shl 4 ) + key[ 0 ]) xor (z + sum ) xor ((z shr 5 ) + key[ 1 ])); inc(z,((y shl 4 ) + key[ 2 ]) xor (y + sum ) xor ((y shr 5 ) + key[ 3 ])); end; for n: = 0 to 3 do begin outdata^ : = BYTE(y shr (n * 8 )); inc(outdata) end; for n: = 0 to 3 do begin outdata^ : = BYTE(z shr (n * 8 )); inc(outdata) end; |
end;
[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课
最后于 2021-10-1 20:39
被JJGuo编辑
,原因:
赞赏
他的文章
谁下载
看原图
赞赏
雪币:
留言: