Take the 2-minute tour ×
Information Security Stack Exchange is a question and answer site for Information security professionals. It's 100% free, no registration required.

I've just started to use GPG and created a public key. It is kind of pointless if no-one knows about it. How should I distribute it? Should I post it on my profile on Facebook and LinkedIn? How about my blog? What are the risks?

share|improve this question
    
Hi @Roger, Welcome to ITSecurity... I retagged since this is a good question that applies to any PGP implementation (or really, any public-key encryption scheme), not just GPG. –  AviD Nov 17 '10 at 12:15
    
I guess it depends on what you use your GPG key for??? Signing emails? Encrypting email content? Encrypted files attached to email? Distributing trustworthy software that you wrote? Storing local files? What size are the files? Are you using mostly symmetric or asymmetric keys (GPG supports both)? Who is going to be needing your pubkey and why? –  atdre Nov 17 '10 at 22:45

6 Answers 6

up vote 30 down vote accepted

You are best to distribute your key is using one of the key servers that are available such as http://keyserver.ubuntu.com:11371/, http://pgp.mit.edu/ and https://keyserver.pgp.com. If you use seahorse (default key manager under Ubuntu) it automatically syncs your keys to one of these servers. Users can then lookup your key using your email address or keyid.

If you wanted to post your public key on Facebook, LinkedIn or your blog you can either upload the key to your server or just link to the page for your key on one of the keyservers above. Personally I would upload it to one of the keyservers and link to it as its easier to keep up-to-date in one place instead of having the file in loads of different locations. You could also share your keyid with people and then they can receive your key using 'gpg --recv-keys'.

For example my public key.

There are no risks to my knowledge associated with publishing your public key.

share|improve this answer
    
There are no major risks with publishing your public key far and wide. You'll want it in the keyserver system as Mark points out so it can be automatically imported. But it's safe to distribute other ways too. –  Peter Stone Nov 18 '10 at 22:29
3  
Note that publishing the key on PGP keyservers is rather pointless if it is not signed by others. In this case, you should prefer secure distribution means like an SSL homepage. Also, having your little brother sign your key will only provide a trust relationship between you two. Key signing parties or SSL-protected homepages are useful if you aim for secure correspondence with a wider audience. –  pepe Jun 29 '11 at 18:31
1  
My experience is that key servers are somewhat #fail. I have lots of old keys that I've lost from '99 and '00 on pgp.mit.edu for example. It really does not solve the problem properly. –  user239558 Sep 9 '12 at 23:25

There is no risk of exposing your private key, or invalidating your public key, by publishing your public key in the ways you and @Mark described. As @pboin stated, it is designed to be available to the world.

However, there is another issue at hand... One of the core purposes of having and publishing your public key (indeed, this is probably THE MAIN purpose), is to authenticate yourself to other users, enable them to verify authenticity of any messages or data you sign, and protect/encrypt data for your eyes only.
But how would those users know that it's really YOUR public key? For example, if I want to send a private message to @Mark Davidson, using his published key at http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xE493B06DD070AFC8, how do I know that it was the REAL Mark Davidson that published that key, or that pointed me there?
It would be trivial for me to publish my OWN public key, either on mit.edu, on LinkedIn, Facebook, etc, and simply call myself Bill Clinton (or Bill Gates). How could you know otherwise?
Moreover, if somehow I know this is really the right person (e.g., I want to contact an anonymous blogger, via the pk published on his blog - I dont care who he really is, the owner of the site - and thus the pk publisher - is the correct person anyhow) - what's to guarantee the public key was not tampered en route? All the links and sites mentioned so far (ok, with the exception of the pgp keyserver) are HTTP - i.e. no channel protection, i.e. can easily be altered between server and browser.

When using the X.509 / PKI model, there is always somebody trusted that vouches for you. E.g. a well-known Certificate Authority (trusted because the browser vendors vetted them, and added their root certificate to the Trusted Roots Store in the browser) verified your identity, and signed your publickey/certificate. Thus, anyone who wants to verify you are who you say you are, can simply check the signature, and then check out the identity of whoever is vouching for you (and then repeat until finding the well-known trusted root CA).

However, in the PGP model, there is usually no central, trusted authority (though current versions DO allow this). Instead, PGP is based on the web-of-trust model, wherein if you trust someone, they can vouch in turn for someone else's identity.

Regardless, just putting your public key out there does not help anyone verify your identity, nor ensure that encrypted messages will be viewable by the correct person only.

What you CAN do:

  • Publish your public key, much as you and @Mark said - but then provide a public-key token (basically a hash of the public key, like a fingerprint) via a secure channel. E.g. this is now short enough to read over a telephone, if he knows you personally... I've even seen someone put his pk token on his business card, handed out a conference (admittedly this was from a vendor).
  • Start signing your emails, then verifying to the recipient that it was your signature through an out-of-band channel (e.g. over the telephone or in person (gasp!!))
  • Complicate the situation, get a standard X.509 cert and implement SSL (preferably EV) on your website, then anyone can download your pk safe in the knowledge that it came from whoever owns that domain name... (Okay, maybe that works better for big companies...)
    Check out how Microsoft does it...

Aaaaall that aside, it really depends on what this pk is for - if it's just to wow your mother, then dont bother with all that :)
On the other hand, if you have really sensitive communications, or with security-conscious clients, then all the above is important....

share|improve this answer
    
Agree with you on your points AviD following the steps covered on help.ubuntu.com/community/… is probably the best method of ensuring key is valid. –  Mark Davidson Nov 17 '10 at 13:11
    
A certificate is only trusted to the level the user at the end trusts the certificate authority. PGP public keys can be signed by other PGP users, by doing so, one builds a web of trust, allowing me to say, my best friend trusts this key, and I trust him, so I also trust this key. –  ewanm89 Jul 1 '11 at 20:02
    
If you really want to be sure, in any case, out of band verification is needed however the key is distributed. One of the most secure methods is out of band verification on first use, as ssh is setup for, but it requires that the user does an out of band verification of the key fingerprint. –  ewanm89 Jul 1 '11 at 20:02
2  
Entries with @whitehouse.gov on pgp.mit.edu –  Bernhard Heijstek Apr 17 '12 at 6:16
    
Another out-of-band publishing method with domain verification that is now becoming usable is: DNSSEC. –  Pieter Ennes Jul 28 at 21:54

A general solution is to upload it to a keyserver. Another good idea might be to make an entry at Biglumber. This helps to get in contact with other people and maybe to sign each other keys.

Furthermore you should have a look into your inbox and look for contacts who already sign their emails. You could send them an informal mail, that you now have a key and point them to a resource.

A blog entry about your key is also fine. You should provide a link to download your key.

If you use signatures in your mail, you can point to your new key and of course sign every mail.

Remind that you can't delete your key after it is uploaded to a keyserver (and distributed amongst them). Of course, you can revoke it. Furthermore it is assumed that spammers look for those email addresses and send you some "nice offers". When you do keysignings and upload the new signatures, the signature reveals where you've been at a specific date.

share|improve this answer
7  
+1 for mentioning actual risks involved with publishing a keyfile that will contain your e-mail address info, and data leakage via inferences. –  Iszi Jun 2 '11 at 16:09
    
Biglumber, Is it ok to use it? They don't even use https.... –  Pacerier Feb 11 at 3:57

Be aware, any email-address on your key will be shown on public webinterfaces. I get a lot of spam on the email on my key, so it did not put my current email address on the key.

share|improve this answer

The simple answer to your "distribution" question is that you should use whatever method works conveniently for you and your intended recipients, and meets your needs in terms of privacy. E.g. a keyserver can conveniently be used for distributing to many recipients, but as ubi notes a typical keyserver exposes the uid (which typically has your email address) to spammers for all time.

The much harder question is how does your recipient verify that they got the right key for you, rather than something forged which facilitates an attack? You may want to exchange a fingerprint of the key with the other person "out-of-band", e.g. over the phone. Or you can rely on the "web of trust": a chain of signatures of people you trust for the purpose. See these questions for more tips:

share|improve this answer

For distribution, it really depends on your audience. The optimist in me hopes that people will be eager to use my key to encrypt messages and check my signatures. The reality is that managing it has been a non-problem. I've done very well by offering it on my blog and on request.

As for the risks, it's designed to be readily available to the world. Focus those concerns on safeguarding the private key. Put a password around it, and guard it carefully.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.