SRL Archive - Other Scripts

String encryption and decryption.


Harled

2007-10-02 08:00:37

wrote this in like 5 mins.
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.

R0b0t1

2007-10-03 18:20:57

Hope you can say base64.

itSchRis917

2007-10-04 18:54:17

"Base64"! Yay! I can.

Sp0rky

2007-10-05 10:55:42

Hope you can say "Encryption plugin (for SCAR) made by me which does exactly the same thing" (link)

Base64 ftw.

Good job though =)

Harled

2007-10-09 08:47:38

Didnt know about the plugin :hithead:

Thanks for feedback though :)