W
wxf_wxf
Unregistered / Unconfirmed
GUEST, unregistred user!
function EncryptString(InString: string): string;
const
Template = 'aaaa';
CharTable = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
var
I, CharVal: Byte;
StartKey, MultKey, AddKey: Word;
begin
Result := '';
InString := InString + Chr(1);
StartKey := Byte(InString[1]);
MultKey := StartKey * 100;
AddKey := StartKey * 512;
for I := 1 to Length(Template)do
begin
CharVal := Byte(InString[(I mod Length(InString)) + 1]) xor (StartKey shr 8) xor Byte(Template) + Length(InString);
CharVal := (CharVal mod Length(CharTable)) + 1;
Result := Result + CharTable[CharVal];
StartKey := (Byte(Result) + StartKey) * MultKey + AddKey;
end;
end;
const
Template = 'aaaa';
CharTable = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
var
I, CharVal: Byte;
StartKey, MultKey, AddKey: Word;
begin
Result := '';
InString := InString + Chr(1);
StartKey := Byte(InString[1]);
MultKey := StartKey * 100;
AddKey := StartKey * 512;
for I := 1 to Length(Template)do
begin
CharVal := Byte(InString[(I mod Length(InString)) + 1]) xor (StartKey shr 8) xor Byte(Template) + Length(InString);
CharVal := (CharVal mod Length(CharTable)) + 1;
Result := Result + CharTable[CharVal];
StartKey := (Byte(Result) + StartKey) * MultKey + AddKey;
end;
end;