function Encrypt (const s: string; Key: Word) : string;
var
i : byte;
begin
Result[0] := s[0];
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 Decrypt (const s: string; Key: Word) : string;
var
i : byte;
begin
Result[0] := s[0];
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;
전엔 보니 누가 컴포넌트로 만들어 놨던데.. 찾아 보시면 있을겁니다.
const
c1 = 52845;
c2 = 22719;
function Encrypt (const s: string; Key: Word) : string;
var
i : byte;
begin
Result[0] := s[0];
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 Decrypt (const s: string; Key: Word) : string;
var
i : byte;
begin
Result[0] := s[0];
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;
ps : 아는 분이 눈에 띄어서 잠깐 들려 봤다가.... ㅎㅎ
Zzom님 왜 정모때 안왔어욧!!