if you are wanting to use blowfish encryption do it this way
var
s1, s2: TStringStream;
ec: TBlowfishEncryptStream;
dc: TBlowfishDecryptStream;
function encrypt(s: string): string; //note you may need to use a try...finally...end; statement
begin
if (s<>'') then begin
s1:=TStringStream.Create(s); //used as your source string
s2:=TStringStream.Create(''); //make sure destination stream is blank
bf:=TBlowfishEncryptStream.Create('password', s2); //writes to destination stream
bf.copyfrom(s1, s1.size);
bf.free;
result:=s2.datastring;
s2.free;
s1.free;
end;
for decryption you just do the opposite like this:
function decryptt(s: string): string; //note you may need to use a try...finally...end; statement
begin
if (s<>'') then begin
s1:=TStringStream.Create(s); //used as your source string
s2:=TStringStream.Create(''); //make sure destination stream is blank
bf:=TBlowfishDecryptStream.Create('password', s1); //reads from source stream
s2.copyfrom(bf, s1.size); //to destination stream copy contents from bf to the size of source stream
bf.free;
result:=s2.datastring;
s2.free;
s1.free;
end;