⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crypt.~pas

📁 一个很好的企业内部人事管理系统,具有基本的框架和标准的结构,很容易改成具体的复杂的应用系统
💻 ~PAS
字号:
unit crypt;

interface
USES
    Classes;
const
     C1 = 52845;
     C2 = 22719;

function Encrypt( S: String; Key: Word): String;
function Decrypt( S: String; Key: Word): String;

implementation

function Encrypt( S: String; Key: Word): String;
var
   I: Integer;
   j: Integer;
begin
 Result := S;
 for I := 1 to Length(S) do
 begin
  Result[I] := char(byte(S[I]) xor (Key shr 8));
  Key := (byte(Result[I]) + Key) * C1 + C2;
 end;
 s:=Result;
 Result:='';
 for i:=1 to length(s) do
 begin
  j:=Integer(s[i]);
  Result:=Result + Char(65+(j div 26))+Char(65+(j mod 26));
 end;
end;

function Decrypt( S: String; Key: Word): String;
var
   I: Integer;
   j: Integer;
begin
 result:='';
 for i:=1 to (length(s) div 2) do
 begin
  j:=(Integer(s[2*i-1])-65)*26;
  j:=j+(Integer(s[2*i])-65);
  result:=result + Char(j);
 end;
 s:=result;
 for I := 1 to Length(S) do
 begin
  Result[I] := char(byte(S[I]) xor (Key shr 8));
  Key := (byte(S[I]) + Key) * C1 + C2;
 end;
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -