Xceed Zip Compression Library Documentation
EncryptionMethod property
Xceed Zip control reference > Xceed Zip control properties > EncryptionMethod property

Description

The EncryptionMethod property allows you to specify which encryption algorithm should be used by the library when compressing data.

Data type

xcdEncryptionMethod

Possible values

Value Meaning
xemCompatible  Traditional zip encryption (weak).
xemWinZipAES  WinZip 9.0's AES encryption (strong).

Default value

xemCompatible

Declaration (DLL API)  

UINT XzGetEncryptionMethod( HXCEEDZIP hZip );
void XzSetEncryptionMethod( HXCEEDZIP hZip, UINT uValue );

Remarks

The encryption method will only be applied to the zip file if a password is specified in the   EncryptionPassword property. 

Version 6.0 of Xceed Zip Compression Library introduces AES encryption support. Because of export restrictions in some countries, a new license validation had to be implemented. License keys that begin with "ZIP" enable AES encryption support while "ZIL" license keys, either trial or registered, do not activate AES encryption support.

When zipping in trial mode with a "ZIP" (ZIP60 or more recent) license key, if the EncryptionMethod property is set to xemWinZipAES, the EncryptionPassword property will be changed to "This is a trial password" only if it had been modified prior to setting the EncryptionMethod property. If a password other than "This is a trial password" is specified in the EncryptionPassword property after the EncryptionMethod property has been set, a "Set not permitted" error will be thrown. The password can also be specified via the ZipPreprocessingFile event however if a password other than "This is a trial password" is specified, the SkippingFile event will be raised with a xsrNotLicenced skipping reason.

When unzipping an AES-encrypted zip file in trial mode with a "ZIP" license key, the only password that can be used is "This is a trial password" and it must be specified via the EncryptionPassword property, InvalidPassword event, or UnzipPreprocessingFile event. If a password other than "This is a trial password" is specified, the SkippingFile event will be raised with a xsrNotLicenced skipping reason. When unzipping, the EncryptionMethod property does not need to be set.

For both registered and trial "ZIP" and "ZIL" license keys, if the EncryptionPassword property is an empty string, the files will not be encrypted regardless of the value of the EncryptionMethod.

Applicable methods

Zip, Convert

Applicable properties

EncryptionStrength, EncryptionPassword

See Also

Creating secure passwords