hubcrypt relies on the fact that you (probably) already have public and private keypairs, the public keys of which are readily accessible through GitHub’s API. You use them to push code and log in to servers. They’re not limited to those tasks though, as they can be used to encrypt arbitrary data.

Normally public keys are used to encrypt a randomly generated session key for use with a symmetric encryption algorithm. The big reason is that asymmetric encryption is typically much slower than symmetric encryption. [PGP](http://en.wikipedia.org/wiki/Pretty_Good_Privacy#Design) for instance uses this exact scheme.

Jokingly, I said to someone that if they wanted to share a small secret with another GitHub user they could just encrypt them with their public SSH key. So, [hubcrypt was born as a gist](https://gist.github.com/rgbkrk/7827691).

You could of course use GPG and convince the other person you’re communicating with to use GPG as well. Or you could just use the SSH keys you already have to encrypt a message. Sure beats sending it over plain.

## Requirements

The recipient needs to be using an RSA key and have it listed as the last key on github.com/<user>.keys. Linux and OS X before Mavericks should work well.

If your machine doesn’t support ssh-keygen properly, submit an issue and I’ll bemoan that I don’t have a box to test it on for you. Feel free to send us a brand new laptop to test your flavor of operating system with.