Harled
2007-10-02 08:00:37
wrote this in like 5 mins.
have fun and please give feedback of some kind.
have fun and please give feedback of some kind.
program HarledEncrypt;
const
StrTo = 'Fo|bkj'; // String to en/decrypt.
Encrypt = False; // False to decrypt and true to encrypt
DecKey = 14; // Decryption key? Required to decrypt the string.
var
TheXor: Integer; // xor key.
ResultString: string; // result.
function DoEncrypt(EncThisString: string): string; // encrypts or decrypts
var
StrC: Integer;
begin
if (Encrypt) then
TheXor := Random(15) + 1
else
TheXor := DecKey;
for StrC := 1 to Length(EncThisString) do
Result := Result + Chr(Ord(EncThisString[StrC]) xor TheXor);
end;
begin
ClearDebug;
ResultString := DoEncrypt(StrTo);
Writeln('Key '+IntToStr(TheXor));
Writeln(ResultString);
end.