Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Remove Zip EncryptionOpens an encrypted zip archive and rewrites it with no encrypton. Downloads: MS Windows Visual C/C++ Libraries Linux/CentOS C/C++ Libraries MAC OS X C/C++ Libraries Solaris C/C++ Libraries C++ Builder Libraries FreeBSD C++ Libraries HP-UX C++ Libraries BlackBerry QNX C++ Libraries #include <C_CkZip.h> void ChilkatSample(void) { HCkZip zip; BOOL success; zip = CkZip_Create(); // Any string unlocks the component for the 1st 30-days. success = CkZip_UnlockComponent(zip,"Anything for 30-day trial"); if (success != TRUE) { printf("%s\n",CkZip_lastErrorText(zip)); return; } // An encrypted .zip may be "opened" without providing a // password. However, the contents cannot be unzipped // without setting the DecryptPassword property. success = CkZip_OpenZip(zip,"myEncrypted.zip"); if (success != TRUE) { printf("%s\n",CkZip_lastErrorText(zip)); return; } // Set the DecryptPassword property: CkZip_putDecryptPassword(zip,"myPassword"); // Indicate that when the zip is to be written again, // it should be neither AES encrypted, or password-protected // (i.e. older Zip 2.0 encryption) CkZip_putEncryption(zip,0); CkZip_putPasswordProtect(zip,FALSE); // Set the filename of the new unencrypted .zip to be written: CkZip_putFileName(zip,"unencrypted.zip"); // Write the unencrypted .zip // What happens during WriteZipAndClose? -- // The encrypted entries from myEncrypted.zip are streamed in, // decrypted, and then written out directly into unencrypted.zip // In other words, internally the component is smart enough // to stream the data from the existing .zip to the new .zip // automatically, decrypting in the process.. success = CkZip_WriteZipAndClose(zip); if (success != TRUE) { printf("%s\n",CkZip_lastErrorText(zip)); return; } printf("OK!\n"); CkZip_Dispose(zip); } |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.