?? u_encrypt.pas
字號:
unit u_encrypt;//加密單元
interface
uses
classes;
const
C1:integer=12345;
C2:integer=54321;
//=================
g_pwdkey: Integer=888888;
function Encrypt(const S: string; Key: Word): string;
function Decrypt(const S: string; Key: Word): string;
implementation
function Encrypt(const S: string; Key: Word): string;//加密
var
I: Integer;
begin
Result := S;
for I := 1 to Length(S) do
begin
Result[I] := char(byte(S[I]) xor (Key shr 13));
Key := (byte(Result[I]) + Key) * C1 + C2;
end;
if Result='' then
Result:='ERP';
end;
function Decrypt(const S: string; Key: Word): string;//解密
var
I: Integer;
begin
Result := S;
if Result='ERP' then begin Result:=''; exit; end;
for I := 1 to Length(S) do
begin
Result[I] := char(byte(S[I]) xor (Key shr 13));
Key := (byte(S[I]) + Key) * C1 + C2;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -