decrypt the file

Hello all

I am getting a encrypted file (.pgp) and a key which i have to use to decrypt that file. I couldn't understand where to put the key on my unix box so that decryption happens. Please reply.

You need to have gpg in your machine for that.

Look for it, if it is not installed then install it.

Once you are done with installation, use the below help to get the files decrypted.

Considering the installation is done in /usr/local/bin.

  • first the key given to you need to be imported.
    /usr/local/bin/gpg --import <SecretKeyFile.gpg>

  • You can view the key is imported using.
    /usr/local/bin/gpg --list-secret-keys
    /usr/local/bin/gpg --list-keys

  • You can then decrypt the file you want using the below.
    /usr/local/bin/gpg -o <OutputFile> --passphrase <incasePassPhrasegiven> -d <Encrypted PGP file>

this tutorial may be useful for you... Gpg Key-Pair Encryption and Decryption Examples