7za command line -p switch

  • Anonymous - 2012-07-18

    I am using the 7za.exe command line utility programmatically to compress and uncompress archives. I'd like to generate passwords for the archives and am looking to use passwords with a length of approx 170 characters, however it seems that the command line 7za has a 99 character limit for password length. Using the UI for 7-Zip File Manager allows a password to be over 100 characters.

    Anyone come across this before or know a work-around (other than using shorter passwords obviously!)? My command line looks something like this:

    7za.exe a -t7z -mx1 -mem=AES256 -p1234567890123456789212345678931234567894123456789512345678961234567897123456789812345678991234567890 -mhe "C:\test.zip" "C:\test.dat"

    Which fails with a 'The parameter is incorrect" error. A 99 character password works fine..

  • Anonymous - 2012-07-18

    Why so ridiculously long? Believe that, with aes256 as used by 7zip,  I saw somewhere that 30? characters would take many years to crack and is enough even for the paranoid! J

  • fernando

    fernando - 2012-07-19

    You want ZIP or 7-Zip archive (-t7z <> c:\test.zip)?
    There is no -mem for 7-Zip archive; AES-256 encryption

    $ 7za a c:\test.7z c:\test.dat -mhe -mx1 -p123456789012345678921234567893123456789412345678951234567896123456789712345678981234567891234567890ABCDEFabcdefABCDEF

    7-Zip (A) 9.20  Copyright (C) 1999-2010 Igor Pavlov  2010-11-18

    Creating archive c:\test.7z

    Compressing  test.dat

    Everything is Ok


  • Anonymous - 2012-07-19

    The use of the long password is just ease - it can be decrypted and encrypted from known values using our X509 certfiicate.

    ikxcsshcm7 - Great thanks a lot for your help that has done the job for me! It seems that zip compression will not allow such a lengthy password however the standard 7z compression will. Many thanks for your help!!


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks