程序员是否都知道 gpg -k 和-K 输出含义 ?

2019-01-26 10:46:58 +08:00
 frylkrttj

gpg -k

pub ***

uid ***

sub ***

gpg -K

sec ****

ssb ***

问题来了,pub,sub,sec,ssb 是什么意思。uid 我知道了。

7471 次点击
所在节点    程序员
85 条回复
frylkrttj
2019-01-26 10:55:42 +08:00
还有一点我想不通:gpg 签名或加密不用选择用私钥匙还是公钥 ?现在都是输入 uid 完事,神知道我是用私钥签名加密的还是公钥?
frylkrttj
2019-01-26 10:59:47 +08:00
我看了阮一峰的教程他都不知道。

https://www.ruanyifeng.com/blog/2013/07/gpg.html
lostberryzz
2019-01-26 11:02:43 +08:00
楼主你这个标题很招人喷
alvin666
2019-01-26 11:12:41 +08:00
笑死,人家没写就是人家不知道?

那你是不是要把你知道的在互联网上都写一遍
dbw9580
2019-01-26 11:24:16 +08:00
我不知道,但是我会去看 GPG 的手册,而不是上网发废文。
disk
2019-01-26 11:27:45 +08:00
为什么要知道?想知道 man gpg 看一下很难?
maogang39
2019-01-26 11:31:09 +08:00
私钥签名,公钥验证
公钥加密,私钥解密。
gpg -k 公钥信息
gpg -K 私钥信息

非程序员的小白个人理解。。
frylkrttj
2019-01-26 11:36:59 +08:00
@alvin666 看人家博客下面的讨论谢谢。

@bw9580 @disk 没找到
sdijeenx
2019-01-26 11:59:47 +08:00
you will find this definition by gpg documentation.

--list-keys
-k
--list-public-keys
List the specified keys. If no keys are specified, then all keys from the configured public keyrings are listed.

Never use the output of this command in scripts or other programs. The output is intended only for humans and its format is likely to change. The --with-colons option emits the output in a stable, machine-parseable format, which is intended for use by scripts and other programs.

--list-secret-keys
-K
List the specified secret keys. If no keys are specified, then all known secret keys are listed. A # after the initial tags sec or ssb means that the secret key or subkey is currently not usable. We also say that this key has been taken offline (for example, a primary key can be taken offline by exporting the key using the command --export-secret-subkeys). A > after these tags indicate that the key is stored on a smartcard. See also --list-keys.


https://gnupg.org/documentation/manuals/gnupg/Operational-GPG-Commands.html#Operational-GPG-Commands
unknown32767
2019-01-26 12:00:18 +08:00
frylkrttj
2019-01-26 12:07:21 +08:00
@sdijeenx #7

@maogang39 #9

说了等于没说系列

@unknown32767 #10 打不开链接
sdijeenx
2019-01-26 12:15:58 +08:00
看吧这就是技术忽悠博客为什么有市场的原因╮( ̄▽ ̄)╭
frylkrttj
2019-01-26 12:17:15 +08:00
@sdijeenx 真正的问题是我帖子最下面那行,跟 #1 楼
sdijeenx
2019-01-26 12:26:50 +08:00
pub = public key
sub = public subkey
sec = secret key
ssb = secret subkey
frylkrttj
2019-01-26 12:27:32 +08:00
@sdijeenx 等你给我 #1 的答案
chinvo
2019-01-26 12:28:07 +08:00
我有点想屏蔽你了,不要整天搞事情好不好?
sdijeenx
2019-01-26 12:38:35 +08:00
私钥保密公钥公开,喜欢的话你可以反过来用。
@chinvo I say 'what the holy crap' when I try to understand what did she means╮( ̄▽ ̄)╭
dobelee
2019-01-26 12:42:06 +08:00
很恶心这种。人各有所长。
chinvo
2019-01-26 12:44:45 +08:00
如果你想表达自己不懂,来提问,请用提问的方式,这里有一篇 提问的智慧 可以帮助你更好地获取知识

@sdijeenx #17 反过来极大几率出事

因为通常导出的私钥中其实是同时包含 n d e 的,所以可以从私钥文件导出公钥
2exploring
2019-01-26 12:59:11 +08:00
回你一楼的问题,加密用公钥,签名用私钥,这是非对称密钥体系的常识。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/530782

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX