//加密
function Tfrmmain.SetEncryption(strValue: String): String;
var
TempChar: Char;
PrexValue: String;
I, strLength: Integer;
begin
if Trim(strValue) = '' then
begin
Result := '';
Exit;
end; strValue := Trim(strValue);
strLength := Length(strValue); for I := 1 to strLength DIV 2 do
begin
TempChar := strValue[I];
strValue[I] := strValue[strLength - I + 1];
strValue[strLength - I + 1] := TempChar;
end; PrexValue := IntToStr(Random(100000));
if Length(PrexValue) > 4 then
PrexValue := Copy(PrexValue, 1, 4)
else begin
PrexValue := StringOfChar('0', 4 - Length(PrexValue)) + PrexValue;
end; strValue := PrexValue + strValue; PrexValue := IntToStr(Random(100000));
if Length(PrexValue) > 4 then
PrexValue := Copy(PrexValue, 1, 4)
else begin
PrexValue := StringOfChar('0', 4 - Length(PrexValue)) + PrexValue;
end; strValue := strValue + prexValue; for I := 1 to Length(strValue) do
begin
TempChar := strValue[I];
TempChar := Char(Ord(TempChar) + 10);
strValue[I] := TempChar;
end; Result := strValue;
end;//解密
function Tfrmmain.SetDecryption(strValue: String): String;
var
TempChar: Char;
I, strLength: Integer;
begin
if Trim(strValue) = '' then
begin
Result := '';
Exit;
end; strValue := Trim(strValue); for I := 1 to Length(strValue) do
begin
TempChar := strValue[I];
TempChar := Char(Ord(TempChar) - 10);
strValue[I] := TempChar;
end; strValue := Copy(strValue, 5, Length(strValue) - 4);
strValue := Copy(strValue, 1, Length(strValue) - 4); strLength := Length(Trim(strValue)); for I := 1 to strLength DIV 2 do
begin
TempChar := strValue[I];
strValue[I] := strValue[strLength - I + 1];
strValue[strLength - I + 1] := TempChar;
end; Result := strValue;
end;
加密效果
加密前:
DATABASE NAME=InfoDB
Server NAME=172.18.1.177
USER NAME=sa
BLOBS TO CACHE=1024
BLOB SIZE=1024
加密后:
::::oxsvxyvksmoz}GOWKX*O]KLK^KN=;=A
B@;:AA;8;8B;8<A;GOWKX*|o€|o]<:<?
<A<Ck}GOWKX*\O]_@A;@
=;B@><:;GORMKM*Y^*]LYVL;@;A
=A<<><:;GOdS]*LYVL><?@
B<:;@?>=<;GN\Ya]]KZ>A>A
PASSWORD=123456
function Tfrmmain.SetEncryption(strValue: String): String;
var
TempChar: Char;
PrexValue: String;
I, strLength: Integer;
begin
if Trim(strValue) = '' then
begin
Result := '';
Exit;
end; strValue := Trim(strValue);
strLength := Length(strValue); for I := 1 to strLength DIV 2 do
begin
TempChar := strValue[I];
strValue[I] := strValue[strLength - I + 1];
strValue[strLength - I + 1] := TempChar;
end; PrexValue := IntToStr(Random(100000));
if Length(PrexValue) > 4 then
PrexValue := Copy(PrexValue, 1, 4)
else begin
PrexValue := StringOfChar('0', 4 - Length(PrexValue)) + PrexValue;
end; strValue := PrexValue + strValue; PrexValue := IntToStr(Random(100000));
if Length(PrexValue) > 4 then
PrexValue := Copy(PrexValue, 1, 4)
else begin
PrexValue := StringOfChar('0', 4 - Length(PrexValue)) + PrexValue;
end; strValue := strValue + prexValue; for I := 1 to Length(strValue) do
begin
TempChar := strValue[I];
TempChar := Char(Ord(TempChar) + 10);
strValue[I] := TempChar;
end; Result := strValue;
end;//解密
function Tfrmmain.SetDecryption(strValue: String): String;
var
TempChar: Char;
I, strLength: Integer;
begin
if Trim(strValue) = '' then
begin
Result := '';
Exit;
end; strValue := Trim(strValue); for I := 1 to Length(strValue) do
begin
TempChar := strValue[I];
TempChar := Char(Ord(TempChar) - 10);
strValue[I] := TempChar;
end; strValue := Copy(strValue, 5, Length(strValue) - 4);
strValue := Copy(strValue, 1, Length(strValue) - 4); strLength := Length(Trim(strValue)); for I := 1 to strLength DIV 2 do
begin
TempChar := strValue[I];
strValue[I] := strValue[strLength - I + 1];
strValue[strLength - I + 1] := TempChar;
end; Result := strValue;
end;
加密效果
加密前:
DATABASE NAME=InfoDB
Server NAME=172.18.1.177
USER NAME=sa
BLOBS TO CACHE=1024
BLOB SIZE=1024
加密后:
::::oxsvxyvksmoz}GOWKX*O]KLK^KN=;=A
B@;:AA;8;8B;8<A;GOWKX*|o€|o]<:<?
<A<Ck}GOWKX*\O]_@A;@
=;B@><:;GORMKM*Y^*]LYVL;@;A
=A<<><:;GOdS]*LYVL><?@
B<:;@?>=<;GN\Ya]]KZ>A>A
PASSWORD=123456
function Tfrmmain.SetEncryption(strValue: String): String;
var
TempChar: Char;
PrexValue: String;
I, strLength: Integer;
begin
if Trim(strValue) = '' then
begin
Result := '';
Exit;
end; strValue := Trim(strValue);
strLength := Length(strValue); for I := 1 to strLength DIV 2 do
begin
TempChar := strValue[I];
strValue[I] := strValue[strLength - I + 1];
strValue[strLength - I + 1] := TempChar;
end; PrexValue := IntToStr(Random(100000));
if Length(PrexValue) > 4 then
PrexValue := Copy(PrexValue, 1, 4)
else begin
PrexValue := StringOfChar('0', 4 - Length(PrexValue)) + PrexValue;
end; strValue := PrexValue + strValue; PrexValue := IntToStr(Random(100000));
if Length(PrexValue) > 4 then
PrexValue := Copy(PrexValue, 1, 4)
else begin
PrexValue := StringOfChar('0', 4 - Length(PrexValue)) + PrexValue;
end; strValue := strValue + prexValue; for I := 1 to Length(strValue) do
begin
TempChar := strValue[I];
TempChar := Char(Ord(TempChar) + 10);
strValue[I] := TempChar;
end; Result := strValue;
end;//解密
function Tfrmmain.SetDecryption(strValue: String): String;
var
TempChar: Char;
I, strLength: Integer;
begin
if Trim(strValue) = '' then
begin
Result := '';
Exit;
end; strValue := Trim(strValue); for I := 1 to Length(strValue) do
begin
TempChar := strValue[I];
TempChar := Char(Ord(TempChar) - 10);
strValue[I] := TempChar;
end; strValue := Copy(strValue, 5, Length(strValue) - 4);
strValue := Copy(strValue, 1, Length(strValue) - 4); strLength := Length(Trim(strValue)); for I := 1 to strLength DIV 2 do
begin
TempChar := strValue[I];
strValue[I] := strValue[strLength - I + 1];
strValue[strLength - I + 1] := TempChar;
end; Result := strValue;
end;
加密效果
加密前:
DATABASE NAME=InfoDB
Server NAME=172.18.1.177
USER NAME=sa
BLOBS TO CACHE=1024
BLOB SIZE=1024
加密后:
::::oxsvxyvksmoz}GOWKX*O]KLK^KN=;=A
B@;:AA;8;8B;8<A;GOWKX*|o€|o]<:<?
<A<Ck}GOWKX*\O]_@A;@
=;B@><:;GORMKM*Y^*]LYVL;@;A
=A<<><:;GOdS]*LYVL><?@
B<:;@?>=<;GN\Ya]]KZ>A>A
PASSWORD=123456
加密前:
DATABASE NAME=InfoDB
Server NAME=172.18.1.177
USER NAME=sa
BLOBS TO CACHE=1024
BLOB SIZE=1024
PASSWORD=123456
加密后:
::::oxsvxyvksmoz}GOWKX*O]KLK^KN=;=A
B@;:AA;8;8B;8<A;GOWKX*|o€|o]<:<?
<A<Ck}GOWKX*\O]_@A;@
=;B@><:;GORMKM*Y^*]LYVL;@;A
=A<<><:;GOdS]*LYVL><?@
B<:;@?>=<;GN\Ya]]KZ>A>A
Email:[email protected]
请问你是叫马科吗?