利用ASCII码的转换,就是先将密码转成ASCII码,经过一定的运算后再转成字符,再通过逆运算进行还原

解决方案 »

  1.   

    转换后保存在注册表中,把自己的算法写到DLL中
      

  2.   

    可以使用以下两个函数实现加密和解密:function EncStr(const s: string): string;
    const
      C1 = 52845;
      C2 = 22719;
    var
      i: integer;
      Key: word;
    begin
      Key := 12345;
      SetLength(Result, length(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;
    end;function DecStr(const s: string): string;
    const
      C1 = 52845;
      C2 = 22719;
    var
      i: integer;
      Key: word;
    begin
      Key := 12345;
      SetLength(Result, length(s));
      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;
    在很多地方都可以找到这些函数的