I wouldn't rely on any of the encryption provided by 7zip. In fact, I'd avoid symmetric encryption if you can do so and use asymmetric incryption instead so that you won't need a passphrase to do the actual encryption.
If you're asking about best practice, then OpenPGP is the way to go so the data can be both encrypted and signed, but at least encrypted. You probably already have GNUpg 2 installed and available, it uses OpenPGP. If your system is a desktop, then it is also quite likely that you have an OpenPGP agent up and running.
That way you can use asymmetric encryption for automatic encryption without having to worry about your passphrase getting stolen. For decryption, you'd need the corresponding private key and its passphrase but those can be kept separately, perhaps even on a separate machine.
Here's how it'd be done for key 474EA2F4F9BBB0CA3705AEDD965A4FB116B21B9 using
gpg2 which uses OpenPGP:
Code:
gpg2 --batch --encrypt --recipient 474EA2F4F9BBB0CA3705AEDD965A4FB116B21B9 file
That would give you the encrypted file
file.gpg while leaving the original clear text unchanged. The original would have to be deleted manually, same for any residue left in the file system if that is important. Or you could have
gpg2 read from stdin and pipe in the output directly from
7zip instead. Here's how it'd be done with the regular tools, I'll leave 7zip up to you.
Code:
tar cf - /path/to/somewhere/ \
| gzip -c \
| gpg2 --batch --encrypt --recipient 474EA2F4F9BBB0CA3705AEDD965A4FB116B21B9 - \
> archive.tar.gz.gpg
See "man gpg2" and "man gpg-agent"