# [solved] Should I backup my public GPG key?

## grant123

Do I need to backup my public GPG key or will the private key alone allow me to decrypt?Last edited by grant123 on Sun Apr 27, 2014 2:45 pm; edited 1 time in total

----------

## eccerr0r

You just need the private key to decrypt (if everyone has your public key, everyone could decrypt?), and you can generate the public key with the private key.

----------

## grant123

 *Quote:*   

> you can generate the public key with the private key

 

Can anyone confirm this?  If it's true, I see no reason to backup the public key.

----------

## John R. Graham

Convenience? It's so small. Also, do you want to lose all the public keys on your key ring you've collected from others? Back up both.

The private key contains all the necessary information to manufacture the public key, but I'm unaware of an existing command with gpg to do so. Yet another reason to back up both.

- John

----------

## eccerr0r

You should definitely back up public keys from other people as you cannot regenerate these.  But the amount of data we're talking about is so small compared to the size of a typical music file, why not back up everything?

I did see a quick search and it looks like it is possible to make gpg dump out new public keys from your secure keychain that includes the private key, if you're backing that up, you should be good to go?

Not sure if this is just a pedantic scrutinizing of documentation indicating key backups or not... but yes I think you're right if you want to save one 4K block of disk space...

----------

## John R. Graham

For my edification, could you share that command, please?

- John

----------

## krinn

Well, all public keys purpose are to be shared, hence why they are "public"  :Smile: 

If you don't backup your public key, you won't be able to share it.

And if you cannot share it, why use any private key if you have nothing to decipher then?

----------

## grant123

krinn, what I'm wondering at this point is how to generate the public key from the private key.

----------

## krinn

ssh-keygen -y

To validate theory, ok for ssh and not gpg, but to keep you waiting more for eccerr0r's answer for gpg  :Smile: 

----------

## eccerr0r

LMGTFY, I am not a frequent GPG user.

http://www-old.gnupg.org/faq/GnuPG-FAQ.html#sec-5-21

----------

## krinn

 *eccerr0r wrote:*   

> LMGTFY, I am not a frequent GPG user.
> 
> http://www-old.gnupg.org/faq/GnuPG-FAQ.html#sec-5-21

 

But i have never doubt on your google skills  :Smile: 

----------

## grant123

Very cool, thank you all!

```
gpgsplit --no-split --secret-to-public secret.gpg >publickey.gpg
```

----------

