7zip-cpp icon indicating copy to clipboard operation
7zip-cpp copied to clipboard

Encrypt filenames

Open yoyixms opened this issue 3 years ago • 1 comments

Hi, I was able to set a password using the compressor. but it seems it does not encrypt the file names. is this possible?

Thanks!

yoyixms avatar Mar 12 '21 07:03 yoyixms

At a glance, looks like 7zip com API needs -mhe option passed to encrypt archive header (ref https://www.cnx-software.com/2011/02/22/aes-256-encryption-and-file-names-encryption-with-7-zip-7z/), likely somewhere around https://github.com/getnamo/7zip-cpp/blob/0cbebfbef54731db9df49baaa8adde38936eeed3/7zpp/SevenZipCompressor.cpp#L157 or https://github.com/getnamo/7zip-cpp/blob/0cbebfbef54731db9df49baaa8adde38936eeed3/7zpp/ArchiveUpdateCallback.cpp needs to be modified to update archive with desired settings, I'm not 100% sure since it's been a while since I've looked at this.

That should hopefully get you started on how to modify source to add the feature.

NB: These were the changes done by https://github.com/KocourKuba to add encryption support (https://github.com/getnamo/7zip-cpp/commit/661c0f27cbbdf3ca4560ec9e3f399d8d3169c42d#diff-3087414f04c94500ca05e45e07d945c3a9df425ebd2f77de5e34e38ea4df95f5)

getnamo avatar Mar 12 '21 20:03 getnamo