How can I decrypt a .pgp
file to .txt
file using a key(.asc file) with the Linux command line.
1 Answer
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
-
when I do the 'gpg --import filename.asc' it returns an error: gpg: WARNING: unsafe ownership on configuration file `/home/mypath/.gnupg/gpg.conf'– RichMoCommented Apr 7, 2017 at 15:09
-
if your user is named
mypath
the do achown mypath:mypath ~/.gnupg/gpg.conf
Commented Apr 7, 2017 at 15:35 -
Looks like I do not have permissions. Waiting on the NetAdm to provide those.– RichMoCommented Apr 7, 2017 at 18:00