16

How can I decrypt a .pgp file to .txt file using a key(.asc file) with the Linux command line.

RichMo
  • 161

1 Answers1

19

Import your private key:

cat mykey.asc # should start with
-----BEGIN PGP PRIVATE KEY BLOCK-----
gpg --import mykey.asc

Check if it shows up:

gpg --list-secret-keys

Decrypt a message:

gpg --output ./decrypted_msg.txt --decrypt ./encrypted_msg.txt