unit Unit2;
interface
uses
Controls,
Classes,
SysUtils;
// 加密方法一(通过密钥加密解密)
function EncryptString(Source, Key: string): string;
function UnEncryptString(Source, Key: string): string;
//加密方法二(通过移位加密解密)
function Encode(Str: string): string;
function Decode(Str: string): string;
//加密方法三(异或加密解密)
function Enc(str: string): string;
function Dec(str: string): string;
implementation
var XorKey: array[0..7] of Byte = ($B2, $09, $AA, $55, $93, $6D, $84, $47);
function EncryptString(Source, Key: string): string;
// 对字符串加密(Source:源 Key:密匙)
var
KeyLen: integer;
KeyPos: integer;
Offset: integer;
Dest: string;
SrcPos: integer;
SrcAsc: integer;
Range: integer;
begin
KeyLen := Length(Key);
if KeyLen = 0 then
Key := 'delphi';
KeyPos :