用gpg(Gnu 隐私卫士)来生成自己的密钥
回家折腾建立ubuntu本地源,这个很有用,特别是在上网算流量的学校用linux,方法主要参照这个wiki页面:
http://wiki.ubuntu.org.cn/使用apt-move创建软件库光盘
root@ubuntu:/mirrors/debian# gpg -bao dists/karmic/Release.gpg dists/karmic/Release
gpg: directory `/home/tun/.gnupg' created
gpg: new configuration file `/home/tun/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/tun/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/tun/.gnupg/secring.gpg' created
gpg: keyring `/home/tun/.gnupg/pubring.gpg' created
gpg: no default secret key: secret key not available
gpg: signing failed: secret key not available
当执行以上蓝色字体的命令的时候出错了。这个命令功能是生成Release文件的gpg密钥。从字面意思来理解应该是gpg没有默认的gpg密钥, 参照这个minihowto: Gnu 隐私卫士 (GnuPG) 袖珍 HOWTO (中文版) 发现可以用gpg –gen-key来生成自己的密钥:(蓝色字体是我输入的)
root@ubuntu:/mirrors/debian# gpg –gen-key
gpg (GnuPG) 1.4.9; Copyright (C) 2008 Free Software Foundation, Inc.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Please select what kind of key you want:
(1) DSA and Elgamal (default)
(2) DSA (sign only)
(5) RSA (sign only)
Your selection? 1
DSA keypair will have 1024 bits.
ELG-E keys may be between 1024 and 4096 bits long.
What keysize do you want? (2048) (直接回车)
Requested keysize is 2048 bits
Please specify how long the key should be valid.
0 = key does not expire
<n> = key expires in n days
<n>w = key expires in n weeks
<n>m = key expires in n months
<n>y = key expires in n years
Key is valid for? (0) (直接回车)
Key does not expire at all
Is this correct? (y/N) y
You need a user ID to identify your key; the software constructs the user ID
from the Real Name, Comment and Email Address in this form:
"Heinrich Heine (Der Dichter) <heinrichh@duesseldorf.de>"
Real name: tunpishuang
Email address: tunpishuang@gmail.com
Comment: just 4 fun.
You selected this USER-ID:
"tunpishuang (just 4 fun.) <tunpishuang@gmail.com>"
Change (N)ame, (C)omment, (E)mail or (O)kay/(Q)uit? o
You need a Passphrase to protect your secret key.
gpg: gpg-agent is not available in this session
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
++++++++++++++++++++++++++++++.+++++.++++++++++++++++++++++++++++++.++++++++++++++++++++++++++++++.+++++++++++++++++++++++++.+++++.+++++>+++++.+++++……………..>+++++…+++++
ds
Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 283 more bytes)
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
+++++…++++++++++..++++++++++.++++++++++..+++++++++++++++..+++++…++++++++++++++++++++.+++++++++++++++++++++++++.+++++..++++++++++++++++++++++++++++++…+++++..+++++>…++++++++++>+++++.>.+++++……<.+++++……………..<+++++>..+++++…………………………………………………………………………………………………………………………………………..<+++++…>+++++…………………………………..+++++^^^^^^^^^
(上面这一砣蓝字的主要意思是通过移动鼠标和写入/输出硬盘数据来生成随机数字,我一般使用du / 命令)
gpg: key EDA38ECC marked as ultimately trusted
public and secret key created and signed.
gpg: checking the trustdb
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u
pub 1024D/EDA38ECC 2009-08-20
Key fingerprint = 8B43 BB97 2716 0124 83C5 D73B DEE3 732F EDA3 8ECC
uid tunpishuang (just 4 fun.) <tunpishuang@gmail.com>
sub 2048g/15197563 2009-08-20
root@ubuntu:/mirrors/debian# gpg –list-keys (生成成功了)
/home/tun/.gnupg/pubring.gpg
—————————-
pub 1024D/EDA38ECC 2009-08-20
uid tunpishuang (just 4 fun.) <tunpishuang@gmail.com>
sub 2048g/15197563 2009-08-20
root@ubuntu:/mirrors/debian# apt-key list (通过这个我们发现改gpg的key和apt的key不是一个库的,但是可以通过gpg导入到apt-key中)
/etc/apt/trusted.gpg
——————–
pub 1024D/437D05B5 2004-09-12
uid Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>
sub 2048g/79164387 2004-09-12
pub 1024D/FBB75451 2004-12-30
uid Ubuntu CD Image Automatic Signing Key <cdimage@ubuntu.com>
root@ubuntu:/mirrors/debian# gpg -bao dists/karmic/Release.gpg dists/karmic/Release (执行成功)
You need a passphrase to unlock the secret key for (这点输入私人密钥就ok)
user: "tunpishuang (just 4 fun.) <tunpishuang@gmail.com>"
1024-bit DSA key, ID EDA38ECC, created 2009-08-20
gpg: gpg-agent is not available in this session
用gpg(Gnu 隐私卫士)来生成自己的密钥相关推荐
- 隐私保护与生成模型: 差分隐私GAN的梯度脱敏方法
点击蓝字 关注我们 AI TIME欢迎每一位AI爱好者的加入! 大规模数据的收集和利用大幅提升了机器学习算法的性能,但同时也令个人隐私保护面临更大的风险与挑战.为此,我们提出一种满足差分隐私(Diff ...
- 手机卫士Android+V2.9.7正式版,LEO隐私卫士[手机隐私卫士] v2.9 android版
LEO隐私卫士:一款非常专业的手机管理类安卓软件.用户们在这里可以非常方便的,全方位的管理你的手机,完全无需在为手机里重要资料外泄而担忧.赶紧试试看吧! 官方介绍: 隐私卫士是一款免费的手机应用管理软 ...
- 【转】手机佳软推荐:LBE隐私卫士
原文地址 ==> http://www.cnbeta.com/articles/143591.htm 身为Android的用户,最让我苦恼的是隐私和软件关闭问题.连装一个电子书都要求有读取手机 ...
- java 创建ssh用户秘钥,安装Java、Maven、Git,以及生成、拷贝密钥
安装Java.Maven.Git,以及生成.拷贝密钥. 整个过程可以用root用户操作,但为了使部署脚本对普通用户可用,需要注意调整文件的权限. 这里以10.56.69.165为部署服务器,10.56 ...
- LKT系列加密芯片如何预置openssl生成的rsa密钥完成运算(三)
第三篇 如何使用加密芯片完成RSA运算 1.测试目标 使用已经预置RSA密钥的LKT系列加密芯片完成运算 2.测试环境 本示例运行环境为windows系统.测试软件LCS KIT.LKT-K100开发 ...
- LKT系列加密芯片如何预置openssl生成的rsa密钥完成运算(二)
第二篇 openssl生成的rsa密钥如何写入到加密芯片中 1.测试目标 将openssl生成的RSA1024位密钥写入到LKT系列加密芯片的公私钥文件中 2.测试环境 本示例运行环境为windows ...
- NIST:生成安全密码密钥
NIST:生成安全密码密钥 https://ws680.nist.gov/publication/get_pdf.cfm?pub_id=913043 ITL BULLETIN FOR DECEMBER ...
- ssh-keygen生成git ssh密钥
SSH是建立在应用层和传输层基础上的安全协议,其目的是专为远程登录会话和其他网络服务提供安全性的保障,用过SSH远程登录的人都比较熟悉,可以认为SSH是一种安全的Shell.SSH登录是需要用户名和密 ...
- LBE 隐私卫士原理分析
LBE 是业界比较出名的 Android 软件.对作者的能力深感佩服,同时抱着学习的态度,需要研究一下这个软件工作原理.请看分析过程! 看运行现象: 因为他是拦截权限的,所以第一时间看系统服务,发现在 ...
最新文章
- LeetCode实战:两数相加
- Linux常用的基本命令cp、mv、rm、cat、find(三)
- [转]java垃圾回收之循环引用
- jQuery中$(document).ready()和window.onload的区别?
- 为什么开发人员要使用Linux
- java get请求 数组,浅谈vue中get请求解决传输数据是数组格式的问题
- 股票收市前三分钟下单有效吗?
- Java中测试异常的多种方式
- 使用kibana可视化报表实时监控你的应用程序,从日志中找出问题,解决问题
- paip.提升用户体验----c++ c# 配色方案
- 基于SSM和Vue的旅游网和旅游管理系统
- 第五章 PYTHON标准库
- 两分钟,帮你搞懂光纤接头
- 传智播客黑马程序员_Hanselminutes播客48-适用于极客和程序员的入门棋盘游戏
- VS2019安装和使用教程(超详细)
- recv函数linux,linux 下调用recv函数,死循环在recv函数里面,什么原因?
- 9.屏幕宽高比判断(Screen.width,Screen.height)
- 360锁屏壁纸超级好看,于是想保存下来。
- hge引擎配置登录器教程_Hge引擎程序+登录器配置器+配套工具+全套入门教程
- spark TF-IDF特征提取生成文章关键词