Encrypt an existing archive (including file names)

7za

  • File archiver with a high compression ratio.
    Similar to `7z` except that it supports fewer file types but is cross-platform.
    More information: <https://www.7-zip.org>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

7za a {{path/to/encrypted.7z}} -p{{password}} -mhe=on {{path/to/archive.7z}}

click the source code to copy install 7za on any operating system with command-not-found.com