Skip to content

Instantly share code, notes, and snippets.

@NearHuscarl
Last active February 2, 2018 06:16
Show Gist options
  • Save NearHuscarl/5da98bd5c12c9cccefebfde144fb0ac8 to your computer and use it in GitHub Desktop.
Save NearHuscarl/5da98bd5c12c9cccefebfde144fb0ac8 to your computer and use it in GitHub Desktop.
7z option for highest encryption when use with password

Command:

7z a -t7z -m0=lzma2 -mx=9 -mfb=64 -md=32m -ms=on -mhe=on -p dir.7z dir

Explanation:

a                   Add (dir1 to archive.7z)
-t7z                Use a 7z archive
-m0=lzma2           Use lzma2 method
-mx=9               Use the '9' level of compression = Ultra
-mfb=64             Use number of fast bytes for LZMA = 64
-md=32m             Use a dictionary size = 32 megabytes
-ms=on              Solid archive = on
-mhe=on             7z format only : enables or disables archive header encryption
-p{Password}        Add a password

Source:

https://askubuntu.com/questions/928275/7z-command-line-with-highest-encryption-aes-256-encrypting-the-filenames

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment