Xceed Zip for COM/ActiveX on x86/x64 Documentation
Example topics / AES Encryption example for Delphi
In This Topic
    AES Encryption example for Delphi
    In This Topic

    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.