How to? ZIP command: /E3 vs /YC

Jul 29, 2016
55
1
When encrypting a .ZIP file, from the documentation it looks like either /E3 or /YC will both cause AES-256 encryption to be used. So is there any difference between using one or the other (or using both)?

Mark E.
 
May 20, 2008
12,035
127
Syracuse, NY, USA
I just tried these

Code:
zip /e3 zippers\e3.zip *
zip /yc zippers\yc.zip *
zip zippers\xx.zip *
zip /e2 zippers\e2.zip *

All four files were identical!
 
Jul 29, 2016
55
1
It doesn't look like you actually used the /s option, which I think is prerequisite for using any of the other encryption options. Sorry, I forgot to mention that in my first post, but thought that it'd be presumed.
 
May 20, 2008
12,035
127
Syracuse, NY, USA
Yes, my mistake. So I tried again with /S. The /e2 and /yc files cameout different. So I guess I can't answer your question..
 
Jul 29, 2016
55
1
Actually it should /e3, but nevertheless, the ZIP files had different hashes when I used /e3 vs /yc. In fact, I tried using both options on the same command line, and that produced yet another different hash. Used names test1.zip, test2.zip, and test3.zip. Zipped the same exact file each time and used /s"password" on all of them. All 3 ZIP files were the same size.
 
Jan 12, 2014
502
9
Switzerland, SO
Here all files arre different!

/e3 (AES256) and /yc (AES256) has the same filesize but ARE different.

I used those commands ...
Code:
zip /e0 /s"test" test_0.zip test_to_enc.txt
zip /e1 /s"test" test_1.zip test_to_enc.txt
zip /e2 /s"test" test_2.zip test_to_enc.txt
zip /e3 /s"test" test_3.zip test_to_enc.txt
zip /yc /s"test" test_yc.zip test_to_enc.txt

Hashes SHA256 ...
Code:
D:\_Tests\TestZIP\test_0.zip : B7FA65C63AE3DC95AC326FC2AB9318981F30D37FB70F684E764EF2B02A3FFB56
D:\_Tests\TestZIP\test_1.zip : 35A95AA75514399F36B2CAF63190FB81B3C71594E933253116127BC9D5E710D2
D:\_Tests\TestZIP\test_2.zip : 425976ECD4202828FC51370072F96DC56D129CB36A1AE093D2AF3F97ACE553CD
D:\_Tests\TestZIP\test_3.zip : 8F5E82119919D71589F7918448F16F2B5F835AC12B0F75A0238A8110B56B4036
D:\_Tests\TestZIP\test_e3_yc.zip : 67156F6435610572A0CBCB31911D19F6CE76AAACBC14BAC848614CDFA6314578
D:\_Tests\TestZIP\test_yc.zip : C3AFA49AA5210AAAF32526B248C20892B00D2FD9CEA3B9ACDA182656F26CAE58
D:\_Tests\TestZIP\test_yc_e3.zip : 2684BDA48CE963E47C25B59E67E803E15FDAD63D58BAC9BF5BF7B56B421B6ADE

In the attachments are my test files ...
 

Attachments

  • test_1.zip
    175 bytes · Views: 23
  • test_2.zip
    179 bytes · Views: 21
  • test_3.zip
    183 bytes · Views: 21
  • test_to_enc.txt
    16 bytes · Views: 22
  • test_yc.zip
    183 bytes · Views: 23
Last edited:
Jul 29, 2016
55
1
Code:
D:\Users\Mark\Documents\test 4\ZIPEncryptTest>zip /s"password" /e3 test1.zip "..\01 You Are Holy.mp3"
<= D:\Users\Mark\Documents\test 4\01 You Are Holy.mp3
  100 %
D:\Users\Mark\Documents\test 4\ZIPEncryptTest>zip /s"password" /yc test2.zip "..\01 You Are Holy.mp3"
<= D:\Users\Mark\Documents\test 4\01 You Are Holy.mp3
  100 %
D:\Users\Mark\Documents\test 4\ZIPEncryptTest>HASH /SHA512 test1.zip test2.zip
D:\Users\Mark\Documents\test 4\ZIPEncryptTest\test1.zip : 946F82435B6B09DDFF2FF4C58C3D6698C3AF43A310E7ACD737F5E49F3441250E64A9EEF397CE435D08B0711678D7B28B3D696D538757483C13943610CA9892EF
D:\Users\Mark\Documents\test 4\ZIPEncryptTest\test2.zip : F8075472FE4B63275F423EF3E84EA240EDCF5FDFE2875F45E8B4B705DDA727CE766EFE40631AFAC7EA201AF5860130D3133037D1C1F9C1C9F35AC8BF0CFF2EC4

D:\Users\Mark\Documents\test 4\ZIPEncryptTest>zip /s"password" /yc /e3 test3.zip "..\01 You Are Holy.mp3"
<= D:\Users\Mark\Documents\test 4\01 You Are Holy.mp3
  100 %
D:\Users\Mark\Documents\test 4\ZIPEncryptTest>HASH /SHA512 test1.zip test2.zip test3.zip
D:\Users\Mark\Documents\test 4\ZIPEncryptTest\test1.zip : 946F82435B6B09DDFF2FF4C58C3D6698C3AF43A310E7ACD737F5E49F3441250E64A9EEF397CE435D08B0711678D7B28B3D696D538757483C13943610CA9892EF
D:\Users\Mark\Documents\test 4\ZIPEncryptTest\test2.zip : F8075472FE4B63275F423EF3E84EA240EDCF5FDFE2875F45E8B4B705DDA727CE766EFE40631AFAC7EA201AF5860130D3133037D1C1F9C1C9F35AC8BF0CFF2EC4
D:\Users\Mark\Documents\test 4\ZIPEncryptTest\test3.zip : BB04F6BAFE8D253E588F4C924572166B99A5902F9C81966704E00490468DB2027386919A56160E0A867658B218E1B3CCA3A829A99415AC391957A3B6511C754A

D:\Users\Mark\Documents\test 4\ZIPEncryptTest>dir

 Volume in drive D is DATA         Serial number is c008:8942
 Directory of  D:\Users\Mark\Documents\test 4\ZIPEncryptTest\*

 8/26/2022  12:38         <DIR>    .
 8/26/2022  12:38         <DIR>    ..
 8/26/2022  12:37       5,856,460  test1.zip
 8/26/2022  12:37       5,856,460  test2.zip
 8/26/2022  12:38       5,856,460  test3.zip
          17,569,380 bytes in 3 files and 2 dirs    17,571,840 bytes allocated
     316,305,477,632 bytes free

D:\Users\Mark\Documents\test 4\ZIPEncryptTest>

D:\Users\Mark\Documents\test 4\ZIPEncryptTest>alias zip
*zip /p

D:\Users\Mark\Documents\test 4\ZIPEncryptTest>
 
Jan 12, 2014
502
9
Switzerland, SO
@evensenm

Even "/e3 /yc" and "/yc /e3" are different ... see above ...

Also interesting maybe: for example with WinRar (current release v6.11) I could only unpack the "/e0 (Zip 2.0)", same with integrated solution of Total Commander (current release v10.50). With 7-Zip (current release v22.01) it was no problem (could unpack all files)!

PS: I assume you have the same file sizes because you used a larger test file for compressing/encrypting. However: I have principally the same behaviour as you - different AES256 files ... the question is just WHY ...
 

Similar threads