How to show progress with GPG for large files?

progress can do this for you — not quite a progress bar, but it will show progress (as a percentage) and the current file being processed (when multiple files are processed):

gpg ... &
progress -mp $!

It's entirely possible to use the pv in combination with gpg, and I see no reason why it should be avoided, some real example I'm just running now follows:

gpg_fingerprint='055667909AA5B877B2A47BC34311D0FB042CB88F'
file_name='linux-mint-20_timeshift_2020-10-13_11-39-29.tar.bz2'

pv < "$file_name" | gpg \
--compress-algo none \
--cipher-algo aes256 \
--digest-algo sha512 \
--local-user "$gpg_fingerprint" \
--recipient  "$gpg_fingerprint" \
--encrypt-files - > "$file_name".gpg

Tags:

Gpg

Pv