Say I encrypt a file using my private GPG key on my desktop. I then transfer the file to my laptop, and intend to decrypt it. What do I do? I heard something about "exporting a public key", what does this mean? Do I use the private key on my laptop as well? If I do, how do I put the private key from my desktop onto my laptop? I am just transferring encrypted files between my own personal machines, I am not giving them to anyone else, so do I still need the public key?


1 Answer 1


Encryption is done with the public key.
Decryption with the private key.

Keys can bei exported to files and imported on another machine.
It's possible to upload the public key to a keyserver.

listing keys (find your id after "/")

gpg --list-keys

export private key (replace 12345ABCD with your id)

gpg --export-secret-keys --armor 1234ABCD > secret.asc

export public key (replace username@email with your email)

gpg --output public.pgp --armor --export username@email

import private key

gpg --import secret.asc

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .