I think there's an assumption you're making that isn't valid.
Is it possible that the zipfile you are opening and extracting is NOT what you think it is? Is it possible you are opening and extracting a zipfile that was produced by an earlier version of your app that did not use encryption? or a zipfile that was
produced by some other tool?
Is it a possibility is that you are holding open the resulting zipfile, and when you run your app, it is silently throwing and suppressing an exception, with the result that \temp\test.zip is not getting updated?
One thing I didn't point out in your code: you are saving to the file c:\temp\test.zip , and also implicitly including that c:\temp\test.zip into the final zip file. This seems like not something you want to do. If you run the app multiple times
in succession, the size of the final zip file grows and grows.
A way to test this further on your end would be to simplify your test app one more time - instead of using AddDirectory(), call AddFile(). Create a zip file with a single entry in it.
Use a new name for the final zip file (not \temp\test.zip) . then see if you can open that new file and extract the single entry.
Somewhere along the chain there is an assumption that's been made, that is not valid.
I have a test suite with hundreds of tests; some of them specifically focus on creating zip files with AES encryption and then verifying that it is impossible to extract entries from those zip files without supplying a password. So I'm pretty certain
that AES encryption in DotNetZip works.