-
-
[旧帖] [求助]这个是什么加密算法,求大神告诉我算法名称 0.00雪花
-
发表于: 2016-2-17 10:51 1330
-
这个是什么加密算法,求大神告诉我算法名称,介绍一下算法怎么加密的,最好有注释。谢谢
unit PassWord;
interface
uses Windows,Classes,StrUtils,SysUtils;
type
ary=array[0..5] of PChar;
TRoyPass=class(TComponent)
private
aryA:ary;
aryB:ary;
aryC:ary;
Constructor Create(AOwner:TComponent);Override;
function A(paramString:String;var paramArrayOfString:ary):String;
function jdMethod_if(paramString:String;var paramArrayOfString:ary):String;
public
function Encrypt(paramString:string):string;
function Decrypt(paramString:string):string;
protected
end;
implementation
constructor TRoyPass.Create(AOwner:TComponent);
begin
Inherited Create(AOwner);
randomize;
aryA[0] := 'ke3wms';
aryA[1] := 'jnx9i8';
aryA[2] := 'dpqzl6';
aryA[3] := 'vyg1bh';
aryA[4] := '7a4c2f';
aryA[5] := 'u5rto0';
aryB[0] := 'wa6j1c';
aryB[1] := 'fblrk7';
aryB[2] := 'mg9q0s';
aryB[3] := 'vu3zth';
aryB[4] := 'po4xy2';
aryB[5] := 'ni5d8e';
aryC[0] := 'mg9qwc';
aryC[1] := 'vu3zth';
aryC[2] := 'a6j10s';
aryC[3] := 'fbk7lr';
aryC[4] := '5dpoy2';
aryC[5] := '4xni8e';
end;
function TRoyPass.Encrypt(paramString:string):String;
var
str : String;
i,j : Integer;
begin
//randomize;
aryA[0] := 'ke3wms';
aryA[1] := 'jnx9i8';
aryA[2] := 'dpqzl6';
aryA[3] := 'vyg1bh';
aryA[4] := '7a4c2f';
aryA[5] := 'u5rto0';
aryB[0] := 'wa6j1c';
aryB[1] := 'fblrk7';
aryB[2] := 'mg9q0s';
aryB[3] := 'vu3zth';
aryB[4] := 'po4xy2';
aryB[5] := 'ni5d8e';
aryC[0] := 'mg9qwc';
aryC[1] := 'vu3zth';
aryC[2] := 'a6j10s';
aryC[3] := 'fbk7lr';
aryC[4] := '5dpoy2';
aryC[5] := '4xni8e';
str := A(LowerCase(paramString), aryA);
i := length(str);
for j := 1 to 3 do
begin
str := IntToStr(i mod 6) + str;
i := i div 6;
end;
while (length(str) < 60) do
str := str + IntToStr(Random(6));
//Result := str;
result:= jdMethod_if(str, aryB);
end;
function TRoyPass.Decrypt(paramString:string):string;
var
str : string;
i,j : integer;
begin
aryA[0] := 'ke3wms';
aryA[1] := 'jnx9i8';
aryA[2] := 'dpqzl6';
aryA[3] := 'vyg1bh';
aryA[4] := '7a4c2f';
aryA[5] := 'u5rto0';
aryB[0] := 'wa6j1c';
aryB[1] := 'fblrk7';
aryB[2] := 'mg9q0s';
aryB[3] := 'vu3zth';
aryB[4] := 'po4xy2';
aryB[5] := 'ni5d8e';
aryC[0] := 'mg9qwc';
aryC[1] := 'vu3zth';
aryC[2] := 'a6j10s';
aryC[3] := 'fbk7lr';
aryC[4] := '5dpoy2';
aryC[5] := '4xni8e';
str := '';
str := A(paramString, aryB);
i := 0;
for j := 1 to 3 do
i := i * 6 + StrToInt(MidBStr(str,j,1));
str := MidBStr(str,3+1, i);
Result := jdMethod_if(str, aryA);
end;
function TRoyPass.A(paramString:String;var paramArrayOfString:ary):String;
var
str1,str2 : String;
i,j,k : integer;
begin
str1 := '';
str2 := '';
for i:=0 to Length(paramString)-1 do
for j:=0 to 5 do
begin
k := Pos(MidBStr(paramString,i+1,1),paramArrayOfString[j]);
if (k>0) then
begin
str1 := str1 + IntToStr(j);
str2 := IntToStr(k-1) + str2;
break;
end;
end;
Result := str1 + str2;
end;
function TRoyPass.jdMethod_if(paramString:String;var paramArrayOfString:ary):String;
var
str1,str2,str3 : string;
i,j : Integer;
begin
str1 := '';
i := Length(paramString);
if (i mod 2 =1) then
Result :='';
for j := 0 to (i div 2)-1 do
begin
str2 := '';
str2 := paramArrayOfString[StrToInt(MidBStr(paramString,j+1,1))];
str3 := MidBStr(paramString,i - j ,1);
str1 := str1 + MidBStr(str2,StrToInt(str3)+1,1);
end;
Result:= str1;
end;
end.
unit PassWord;
interface
uses Windows,Classes,StrUtils,SysUtils;
type
ary=array[0..5] of PChar;
TRoyPass=class(TComponent)
private
aryA:ary;
aryB:ary;
aryC:ary;
Constructor Create(AOwner:TComponent);Override;
function A(paramString:String;var paramArrayOfString:ary):String;
function jdMethod_if(paramString:String;var paramArrayOfString:ary):String;
public
function Encrypt(paramString:string):string;
function Decrypt(paramString:string):string;
protected
end;
implementation
constructor TRoyPass.Create(AOwner:TComponent);
begin
Inherited Create(AOwner);
randomize;
aryA[0] := 'ke3wms';
aryA[1] := 'jnx9i8';
aryA[2] := 'dpqzl6';
aryA[3] := 'vyg1bh';
aryA[4] := '7a4c2f';
aryA[5] := 'u5rto0';
aryB[0] := 'wa6j1c';
aryB[1] := 'fblrk7';
aryB[2] := 'mg9q0s';
aryB[3] := 'vu3zth';
aryB[4] := 'po4xy2';
aryB[5] := 'ni5d8e';
aryC[0] := 'mg9qwc';
aryC[1] := 'vu3zth';
aryC[2] := 'a6j10s';
aryC[3] := 'fbk7lr';
aryC[4] := '5dpoy2';
aryC[5] := '4xni8e';
end;
function TRoyPass.Encrypt(paramString:string):String;
var
str : String;
i,j : Integer;
begin
//randomize;
aryA[0] := 'ke3wms';
aryA[1] := 'jnx9i8';
aryA[2] := 'dpqzl6';
aryA[3] := 'vyg1bh';
aryA[4] := '7a4c2f';
aryA[5] := 'u5rto0';
aryB[0] := 'wa6j1c';
aryB[1] := 'fblrk7';
aryB[2] := 'mg9q0s';
aryB[3] := 'vu3zth';
aryB[4] := 'po4xy2';
aryB[5] := 'ni5d8e';
aryC[0] := 'mg9qwc';
aryC[1] := 'vu3zth';
aryC[2] := 'a6j10s';
aryC[3] := 'fbk7lr';
aryC[4] := '5dpoy2';
aryC[5] := '4xni8e';
str := A(LowerCase(paramString), aryA);
i := length(str);
for j := 1 to 3 do
begin
str := IntToStr(i mod 6) + str;
i := i div 6;
end;
while (length(str) < 60) do
str := str + IntToStr(Random(6));
//Result := str;
result:= jdMethod_if(str, aryB);
end;
function TRoyPass.Decrypt(paramString:string):string;
var
str : string;
i,j : integer;
begin
aryA[0] := 'ke3wms';
aryA[1] := 'jnx9i8';
aryA[2] := 'dpqzl6';
aryA[3] := 'vyg1bh';
aryA[4] := '7a4c2f';
aryA[5] := 'u5rto0';
aryB[0] := 'wa6j1c';
aryB[1] := 'fblrk7';
aryB[2] := 'mg9q0s';
aryB[3] := 'vu3zth';
aryB[4] := 'po4xy2';
aryB[5] := 'ni5d8e';
aryC[0] := 'mg9qwc';
aryC[1] := 'vu3zth';
aryC[2] := 'a6j10s';
aryC[3] := 'fbk7lr';
aryC[4] := '5dpoy2';
aryC[5] := '4xni8e';
str := '';
str := A(paramString, aryB);
i := 0;
for j := 1 to 3 do
i := i * 6 + StrToInt(MidBStr(str,j,1));
str := MidBStr(str,3+1, i);
Result := jdMethod_if(str, aryA);
end;
function TRoyPass.A(paramString:String;var paramArrayOfString:ary):String;
var
str1,str2 : String;
i,j,k : integer;
begin
str1 := '';
str2 := '';
for i:=0 to Length(paramString)-1 do
for j:=0 to 5 do
begin
k := Pos(MidBStr(paramString,i+1,1),paramArrayOfString[j]);
if (k>0) then
begin
str1 := str1 + IntToStr(j);
str2 := IntToStr(k-1) + str2;
break;
end;
end;
Result := str1 + str2;
end;
function TRoyPass.jdMethod_if(paramString:String;var paramArrayOfString:ary):String;
var
str1,str2,str3 : string;
i,j : Integer;
begin
str1 := '';
i := Length(paramString);
if (i mod 2 =1) then
Result :='';
for j := 0 to (i div 2)-1 do
begin
str2 := '';
str2 := paramArrayOfString[StrToInt(MidBStr(paramString,j+1,1))];
str3 := MidBStr(paramString,i - j ,1);
str1 := str1 + MidBStr(str2,StrToInt(str3)+1,1);
end;
Result:= str1;
end;
end.
[招生]科锐逆向工程师培训(2024年11月15日实地,远程教学同时开班, 第51期)
赞赏
看原图
赞赏
雪币:
留言: