For examples, I think it's better to use the data type wrapper of the Read/Write, instead of using the low level methods:
{$mode objfpc}{$H+} uses classes,blowfish; var en: TBlowFishEncryptStream; de: TBlowFishDeCryptStream; s1,s2: TStringStream; key,value,temp: String; begin key := 'testkey'; value := 'this is a string'; s1 := TStringStream.Create(''); en := TBlowFishEncryptStream.Create(key,s1); en.WriteAnsiString(value); en.Free; WriteLn('encrypted: ' + s1.DataString); s2 := TStringStream.Create(s1.DataString); s1.Free; de := TBlowFishDeCryptStream.Create(key,s2); temp := de.ReadAnsiString; WriteLn('decrypted: ' + temp); de.Free; s2.Free; end. -- View this message in context: http://free-pascal-general.1045716.n5.nabble.com/encryption-and-decryption-tp5710131p5710147.html Sent from the Free Pascal - General mailing list archive at Nabble.com. _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-pascal