Delphi / C++Builder Streaming Compression Library
with Strong Encryption


Creates an instance of the TCPSCryptoPressStream object.

Delphi syntax:
constructor Create(
BaseStream: TStream;
CryptoParams: TCPSCryptoParams;
CreateNewStream: Boolean = False;
FreeBaseStream: Boolean = True;
CompressionAlgorithm: TCPSCompressionAlgorithm = caZLIB;
CompressionMode: Byte = CPSDefaultCompressionMode;
BlockSize: Integer = CPSDefaultBlockSize;
Header: PChar = nil;
HeaderSize: Integer = 0;
Manager: TComponent = nil;
TempDir: String = ''

C++ syntax:
Classes::TStream* BaseStream,
const Cpscrypto::TCPSCryptoParams &CryptoParams,
bool CreateNewStream,
bool FreeBaseStream,
TCPSCompressionAlgorithm CompressionAlgorithm,
Byte CompressionMode,
int BlockSize,
char * Header,
int HeaderSize,
Classes::TComponent* Manager,
AnsiString TempDir)/* overload */;

Creates an instance of the TCPSCryptoPressStream object.
If CreateNewStream is set to true the TCPSCryptoPressStream will create a new stream in the BaseStream starting from current Position of the BaseStream. All data starting from this position will be overwritten and all data before will be kept without changes.
Thus you can reserve some unencrypted and uncompressed data before the Position in BaseStream.
When CryptoPressStream opens an existing stream it finds its header by the signature, so you can keep any data in BaseStream without problems. For example, you can make a self-extractable application (SFX) by creating TCPSCryptoPressStream with FileStream object passed as a BaseStream with opened executable file for write and with position at the end of stream (Positon = Size).

BaseStream - base stream to store the compressed or encrypted data. Can be accessed later by DirectAccessStream property.
CryptoParams - encryption settings for the stream. Can be retrieved from TCPSManager.CryptoParams.
CreateNewStream - specifies it the new compressed or encrypted stream will be created or an existing stream will be used.
FreeBaseStream - specifies if the CryptoPressStream should destroy BaseStream on destroying or not.
CompressionAlgorithm - specified the compression algorithm for creating new stream.
CompressionMode - specified the compression mode for creating new stream.
BlockSize - specifies the block size for creating new stream.
Header - specifies the additional header for creating new stream. This header will be encrypted if CryptoParams.CryptoAlgorithm <> CPS_Cipher_None.
HeaderSize - specifies the size of the additional header for creating new stream.
Manager - reference to TCPSManager component
TempDir - temporary directory.

© AidAim Software CryptoPressStream: