Tips to use GPG to encrypt file

These are some tips to encrypt a file with the Key ID from a username@domain.com :

Search the user Key ID:

$ gpg --keyserver pgp.mit.edu --search-keys username@domain.com

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

$ gpg --keyserver pgp.mit.edu --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 username@domain.com fileplain.txt

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s