BlowFishDecryptStream

Declaration: BlowFishDecryptStream (pwd: string; InStream, OutStream: TStream): integer;
The function BlowFishDecryptStream decrypts the Blowfish-encrypted stream InStream. The parameter pwd specifies the password. The decrypted stream is written to OutStream, starting at the current stream position (thus overwriting all data at and after OutStream.Position). Please note that an invalid password does not return any error message. In this case the "decrypted" stream will contain an unpredictable binary data stream.

The function returns the following error codes:

 0 ... everything is OK
-1 ... password is empty
-2 ... Instream is empty

Hint: The stream InStream is automatically rewound to ensure that the entire stream is processed.