Skip to content

How do you select WinZip AES-256 encryption for Zip format? #138

Answered by rikyoz
ra-dave asked this question in Q&A
Discussion options

You must be logged in to vote

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):

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 setFormatProperty method supports only wide char C strings, hence the need for the L"..." (in contrast with the rest of t…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by ra-dave
Comment options

You must be logged in to vote
1 reply
@rikyoz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants