-
Zip defaults to ZipCrypto encryption. Is it possible to select WinZip AES-256 instead? I'm looking through the code and it seems like this might not be supported. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi! Bit7zLibrary lib{};
BitFileCompressor compressor( lib, BitFormat::Zip );
compressor.setFormatProperty( L"em", L"AES256" );
compressor.setPassword( "password" );
compressor.compressFile( "path/to/file.txt", "path/to/archive.zip" ); Please note that the Unfortunately, at the moment, bit7z doesn't provide a more user-friendly API for changing the encryption algorithm of ZIP archives. Still, I'll definitely work on adding one in a future version of the library! |
Beta Was this translation helpful? Give feedback.
-
Thanks, that works well! It's so simple I'm not sure I would worry about adding something specifically to your API to make it more user-friendly. Perhaps just documentation (if you don't already have some for this). Very nice library, BTW! |
Beta Was this translation helpful? Give feedback.
Hi!
Changing the encryption algorithm of ZIP archives is "indirectly" supported only since the latest v4.0.0 RC via the
BitCompressor::setFormatProperty
method, which allows you to specify any format property using the same parameters you can use with 7-zip (e.g., https://sevenzip.osdn.jp/chm/cmdline/switches/method.htm):Please note that the
setFormatProperty
method supports only wide char C strings, hence the need for theL"..."
(in contrast with the rest of t…