使用GitHub用户的公钥加密消息。
项目描述
# HubCrypt
- closed_lock_with_key:
for your :octocat
使用风险自担。
## 摘要
使用GitHub用户的公钥加密[*](https://github.com/rgbkrk/hubcrypt/blob/master/README.md#-maximum-message-size-is-based-on-key-size)short消息。
### 加密
`shell $ ./bin/hubencrypt smashwilson secrets.txt secrets.txt.enc Getting the key for smashwilson Converting public key to a PEM PKCS8 public key Encrypting message All done, cleaning up! `
### 解密
`shell $ ./bin/hubdecrypt ~/.ssh/id_rsa secrets.txt.enc secrets.txt Enter pass phrase for /home/ash/.ssh/id_rsa: $ cat secrets.txt Drink more ovaltine. `
## 关于
hubcrypt依赖于你(可能)已经拥有公钥和私钥对,其公钥可以通过GitHub的API轻松访问。你使用它们来推送代码和登录服务器。虽然它们不仅限于这些任务,但也可以用于加密任意数据。
通常,公钥用于加密随机生成的会话密钥,以用于对称加密算法。主要原因是对称加密通常比非对称加密慢得多。[PGP](http://en.wikipedia.org/wiki/Pretty_Good_Privacy#Design) 例如使用此确切方案。
开玩笑地说,我对某人说,如果他们想与其他GitHub用户分享一个小秘密,他们只需用他们的公钥加密即可。[因此,hubcrypt诞生为一个gist](https://gist.github.com/rgbkrk/7827691).
在我发现[其他人](https://github.com/twe4ked/catacomb)在此之前已经做过[一些变体](https://github.com/jschauma/jass)后不久。并不感到惊讶,我总是晚来一步。
当然,你可以使用GPG并说服你正在与之交流的人也使用GPG。或者,你也可以使用你已有的SSH密钥来加密消息。这比发送明文要好得多。
## 要求
接收者需要使用RSA密钥,并将其列出为github.com/<user>.keys上的最后一个密钥。Linux和OS X在Mavericks之前应该运行良好。
如果你的机器无法正确支持ssh-keygen,请提交一个问题,我会抱怨我没有盒子来为你测试。请随意给我们发一台全新的笔记本电脑来测试你的操作系统。
## 示例用法
`shell $ git clone https://github.com/rgbkrk/hubcrypt.git $ ./hubcrypt/bin/hubencrypt smashwilson secrets.txt secrets.txt.enc 获取smashwilson的密钥 将公钥转换为PEM PKCS8公钥 加密消息 完成所有操作,清理中! `
稍后,在[smashwilson](https://github.com/smashwilson)的电脑上
`shell $ git clone https://github.com/rgbkrk/hubcrypt.git $ ./hubcrypt/bin/hubdecrypt ~/.ssh/id_rsa secrets.txt.enc secrets.txt 输入密码短语用于/home/ash/.ssh/id_rsa: $ cat secrets.txt 多喝 Ovaltine. `
你可以将shell脚本复制到任何你喜欢的位置,然后只需运行
或者,只需窃取
## * 最大消息大小(基于密钥大小)
当人们运行
`密钥大小(位) 最大消息大小(字节) 768 85 1024 117 2048 246 4096 502 8192 1018 `
# 0.0.0 (2013-12-8)
概念