GPGTAR(1)

πŸ’… GPGTAR(1) β€” the gpgtar glow-up πŸŽ€

okay so bestie, welcome to gpgtar, a real one from the GNU Privacy Guard 2.4 fam. this page is gonna walk you through it, no gatekeeping, i promise 🫢


✨ NAME ✨

gpgtar β€” encrypt or sign files into an archive. literally what it says on the tin πŸ’…


🌸 SYNOPSIS 🌸

gpgtar [options] filename1 [ filename2, ... ] directory1 [ directory2, ... ]

so yeah, options first, then a whole parade of files and directories. bring the whole group chat, it's fine πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so gpgtar encrypts or signs files into an archive. it's an gpg-ized tar β€” like tar but it went to the crypto gym β€” and it uses the exact same format as PGP's PGP Zip. iykyk ✨


πŸŽ€ OPTIONS πŸŽ€

gpgtar understands these options, and by "understands" i mean it's fluent, bestie:

  • --create β€” puts the files and directories you hand it into a vanilla ``ustar'' archive. plain, classic, iconic.
  • --extract β€” extracts all the files out of a vanilla ``ustar'' archive. if you don't give a file name (or you just pass -), the archive gets read from stdin. sneaky but valid πŸ’…
  • --encrypt, -e β€” encrypts the given files and directories into an archive πŸ”₯ and here's the slay: you can combine this with --symmetric and get an archive that can be decrypted either via a secret key or via a passphrase. flexible queen.
  • --decrypt, -d β€” extracts all the files from an encrypted archive. same deal: no file name (or -) means it comes from stdin.
  • --sign, -s β€” makes a signed archive from the files and directories you give it. and yeah, you can stack this with --encrypt to get a signed-then-encrypted archive. layers, bestie.
  • --list-archive, -t β€” lists the contents of the archive you specified. no file name (or -) β†’ stdin. it's giving "just let me peek" πŸ‘€
  • --symmetric, -c β€” encrypt with a symmetric cipher using a passphrase. the default symmetric cipher is AES-128, but you can pick another one with the --cipher-algo option to gpg. options within options, very meta πŸ’…
  • --recipient user, -r user β€” encrypt for user id user. for the deets, go see gpg. 🫢
  • --local-user user, -u user β€” use user as the key to sign with. again, details live in gpg.
  • --output file, -o file β€” writes the archive to the file file. πŸ“
  • --verbose, -v β€” turns on extra informational output. she's chatty and we love that πŸ—£οΈ
  • --quiet, -q β€” tries to be as quiet as possible 🀫
  • --skip-crypto β€” skips every crypto operation and just creates or extracts vanilla ``ustar'' archives. sometimes you just want the plain version, no makeup.
  • --dry-run β€” doesn't actually output the extracted files. it's the rehearsal, not the show 🎭
  • --directory dir, -C dir β€” extracts the files into the directory dir. the default is to take the directory name from the input filename; if no input filename is known, it uses a directory named GPGARCH. and for tarball creation it switches to directory dir before doing any operations. multitasking icon.
  • --files-from file, -T file β€” takes the file names to work on from file, one file per line. πŸ“
  • --null β€” modifies --files-from so it uses a binary nul instead of a linefeed to separate the file names. spicy separator.
  • --utf8-strings β€” assumes the file names read by --files-from are UTF-8 encoded. heads up though: this only does anything on Windows, where otherwise the active code page is assumed. windows-only behavior, ngl.
  • --openpgp β€” does absolutely nothing, bestie, because OpenPGP encryption and signing is the default anyway. it's just there vibing πŸ’€
  • --cms β€” this one is reserved and shall not be used 🚫 eventually it'll encrypt or sign using the CMS protocol, but that is not yet implemented. respect the reservation.
  • --batch β€” use batch mode: never ask, just use the default action. this option is passed directly to gpg.
  • --yes β€” assumes "yes" on most questions. often used together with --batch to overwrite existing files. also passed directly to gpg. consent, but make it automated ✨
  • --no β€” assumes "no" on most questions. passed directly to gpg. the boundaries option 🫢
  • --require-compliance β€” passed directly to gpg. no notes.
  • --status-fd n β€” writes special status strings to the file descriptor n. check the file DETAILS in the documentation for a list of them πŸ‘‘
  • --with-log β€” when extracting an encrypted tarball, it also writes a log file with the gpg output to a file named after the extraction directory with the suffix .log. receipts.
  • --set-filename file β€” uses the last component of file as the output directory. default is to take the directory name from the input filename, and if there's no input filename it uses a directory named GPGARCH. ⚠️ heads up: this option is deprecated in favor of --directory. we've moved on, bestie.
  • --no-compress β€” tells gpg to disable compression (i.e. it uses option -z0). super useful for archiving only large files that are already compressed (like a set of videos πŸŽ₯). no need to squeeze a squeezed thing.
  • --gpg gpgcmd β€” uses the command gpgcmd instead of gpg. you can swap in your fave ✨
  • --gpg-args args β€” passes the extra options args to gpg.
  • --tar-args args β€” assumes args are standard options of the tar command and parses them. the only supported tar options are --directory, --files-from, and --null. this is an obsolete option, because those supported tar options can also be given directly. history, but make it legacy πŸ’€
  • --tar command β€” a dummy option for backward compatibility. it's there for the old heads 🫢
  • --version β€” prints the version of the program and exits.
  • --help β€” displays a brief help page and exits. the classic πŸ™ˆ

🌈 EXAMPLES 🌈

encrypt the contents of directory mydocs for user Bob into the file test1 β€” iconic request, honestly:

gpgtar --encrypt --output test1 -r Bob mydocs

now list the contents of that archive test1:

gpgtar --list-archive test1

see? slayed. ✨


πŸ”₯ DIAGNOSTICS πŸ”₯

the program returns 0 if everything was fine, and 1 otherwise. binary queen. no gray areas.


πŸ’œ SEE ALSO πŸ’œ

and also: the full documentation for this tool is maintained as a Texinfo manual. if GnuPG and the info program are properly installed at your site, this command:

info gnupg

should give you access to the complete manual, including a menu structure and an index. go read it, it's giving library energy πŸ“š


okay that's the whole page bestie, you're basically a gpgtar expert now πŸ’…βœ¨ this was GnuPG 2.4.9, dated 2025-02-19 β€” mwah, go encrypt something πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from