Discuss this help topic in SecureBlackbox Forum

Compress and encrypt Zip archive

To compress files into a Zip archive you need to create and use an instance of TElZipWriter class.

To create a new archive, call CreateArchive. If you want to add files to an existing archive, use Open method.

When the archive is opened you can add or remove files using Add, AddDirContents, and Remove methods. You may use either synchronous or asynchronous compression. In the first case, once the archive has been populated, simply call Compress.

For asynchronous compression, the following steps should be performed:

To specify archive compression algorithm and compression level, use CompressionAlgorithm and CompressionLevel properties, correspondingly. You may set up encryption parameters of individual archive entries via the corresponding properties of TElZipArchiveDirectoryEntry.

To encrypt the archive, specify Password, and set Encrypt property to True. The archive will be encrypted after compression.

To use WinZip AES encryption, set WinZipEncryption to True. You can specify encrypting key size via WinZipAesKeySize property.

To use PKWare Strong Encryption, set StrongEncryption to True, and specify desired encryption parameters using StrongEncryptionInfo property.

How To articles about Zip file operations

Discuss this help topic in SecureBlackbox Forum