Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Create WinZip Compatible AES Encrypted ZipDelphi sample program showing how to create a WinZip compatible AES encrypted zip with 128-bit AES encryption up to 256-bit AES encryption. // Delphi example code to create a WinZip compatible AES encrypted zip. procedure TForm1.Button10Click(Sender: TObject); var recurse: Integer; success: Integer; begin // UnlockComponent should be called once at the beginning of a program. ChilkatZip21.UnlockComponent('anything for 30-day trial'); // Initialize the zip object. ChilkatZip21.NewZip('test.zip'); // Add a directory tree to the zip object. The AppendFiles // method recursively descends a directory and adds references to // files and directories to the zip object. When the // zip is written (by calling WriteZipAndClose) all referenced files // and directories are added. recurse := 1; ChilkatZip21.AppendFiles('c:/temp/abc/*', recurse); // Set the Encryption property = 4. // The values for Encryption are: // 0: No encryption // 1: Blowfish encryption // 2: Twofish encryption // 3: AES encryption (Chilkat-specific) // 4: AES encryption (WinZip compatible) // The Chilkat zip component implemented strong encryption prior to the // release of WinZip AES encryption. Therefore, encryption modes 1-3 are // not compatible with WinZip. ChilkatZip21.Encryption := 4; // Set the encryption key length to 128-bit, 192-bit, or 256-bit. ChilkatZip21.EncryptKeyLength := 256; // Don't forget to set a password. ChilkatZip21.SetPassword('myPassword'); success := ChilkatZip21.WriteZipAndClose(); if (success = 0) then begin ChilkatZip21.SaveLastError('zipErrorLog.txt'); ShowMessage(ChilkatZip21.LastErrorText); end; ShowMessage('Done!'); end;
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.