Xceed Zip Compression Library Documentation
AES Encryption example for Delphi
Example topics > AES Encryption example for Delphi

This example demonstrates how to use the EncryptionMethod, EncryptionStrength, and EncryptionPassword properties to create an AES encrypted zip file. This example assumes that you have an XceedZip control named XceedZip1 added to a form.

Delphi Copy Code

procedure TForm1.Button1Click(Sender: TObject);

var

   ResultCode : XcdError; 

begin  

   XceedZip1.ZipFilename := 'd:\files.zip';
   XceedZip1.FilesToProcess := 'd:\files\*';
   XceedZip1.ProcessSubfolders := True;  

   XceedZip1.EncryptionMethod := xemWinZipAES;
   XceedZip1.EncryptionStrength := 192;
   XceedZip1.EncryptionPassword := 'password';

   ResultCode := XceedZip1.Zip;  

   ShowMessage( IntToStr( resultCode ) );
end;
end.