Tips to use GPG to encrypt file

These are some tips to encrypt a file with the Key ID from a :

Search the user Key ID:

$ gpg --keyserver --search-keys

Let us to suppose the user Key ID is ABCDEF12 then you receive it:

$ gpg --keyserver --recv-keys ABCDEF12

or if you have the public key of destination user:

$ gpg --import userkey.asc

Finally you encrypt the file this way:

$ gpg --output fileencrypted.gpg --encrypt --recipient fileplain.txt

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s