GnuPG 的PGP使用
1. 生成秘钥对(此处采用默认的RSA, 2048位)
$ gpg --gen-key
gpg (GnuPG) 2.0.; Copyright (C) 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. gpg: directory `/home/webadmin/.gnupg' created
gpg: new configuration file `/home/webadmin/.gnupg/gpg.conf' created
gpg: WARNING: options in `/home/webadmin/.gnupg/gpg.conf' are not yet active during this run
gpg: keyring `/home/webadmin/.gnupg/secring.gpg' created
gpg: keyring `/home/webadmin/.gnupg/pubring.gpg' created
Please select what kind of key you want:
() RSA and RSA (default)
() DSA and Elgamal
() DSA (sign only)
() RSA (sign only)
Your selection?
RSA keys may be between and bits long.
What keysize do you want? ()
Requested keysize is bits
Please specify how long the key should be valid.
= 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? () 10y
最后生成完成后,会有下列的信息显示:
public and secret key created and signed.
2. 查看有哪些公钥
$ gpg --list-keys
3. 导出公钥(用于加密)(ASCII格式适合程序中使用)
$ gpg -a -o pubkey.txt --export test01
此处test01是 --list-keys罗列出来的uid。
4. 导出私钥(用于解密)
$ gpg -a -o prikey.txt --export-secret-keys test01
5. 测试加密和解密
$ gpg -r test01 -e test.txt $ gpg -r test01 -o test.txt -d test.txt.gpg
GnuPG 的PGP使用的更多相关文章
- 《Maven实战》阅读笔记
java -versionmvn -vmvn help:system m2eclipse maven->install MAVEN_OPTS: -Xms128m -Xmx512mmvn clea ...
- DH、RSA与ElGamal非对称加密算法实现及应用
1.对称加密与非对称加密概述 关于对称加密与非对称加密的概念这里不再多说,感兴趣可以看下我之前的几篇文章,下面说一说两者的主要区别. 对称加密算法数据安全,密钥管理复杂,密钥传递过程复杂,存在密钥泄露 ...
- 使用GnuPG(PGP)加密信息及数字签名教程_转
所谓加解密就是一方以密钥加密,另一外收到文件后以相对应的密钥解密,从而获取原始文件.数字签名的过程:信息是通过普通未加密方式发送信息给对方的,只是在每条信息后面都会附加一坨字符(名曰:签名)(或信息与 ...
- openpgp和gnupg
http://www.openpgp.org/about_openpgp/history.shtml https://www.gnupg.org/ History OpenPGP is a non-p ...
- Linux下校验下载文件的完整性(MD5,SHA1,PGP)
查看: Linux下校验下载文件的完整性(MD5,SHA1,PGP) http://blog.useasp.net/archive/2014/03/29/use-md5-sha1-or-pgp-to- ...
- 在Linux上使用PGP签名验证文件完整性
文件在下载及存储过程中可能由于传输错误.硬件故障.文件系统错误等网络.硬件和软件方面的原因导致文件损坏,也可能在传输过程中受到攻击(如"中间人攻击")导致下载的文件被篡改或者下载到 ...
- GPG(GnuPG)入门
GPG(GnuPG)入门 下载: https://gnupg.org/download/index.html 或者 http://www.hellopp.cn/page/5b9a1405c3f1f7d ...
- PGP NO_PUBKEY
horizon@horizon-pc ~ $ sudo apt-get update Ign http://packages.linuxmint.com rebecca/upstream Transl ...
- 非对称加密与GPG/PGP
最近浏览博客的时候,经常会看到博主展示出自己的公钥,于是对 GPG/PGP 产生兴趣.下面简单记录相关文章的链接,方便以后了解. 简介: 1991年,程序员Phil Zimmermann为了避开政府的 ...
随机推荐
- c#中文转全拼或首拼
参考:http://www.jb51.net/article/42217.htmhttp://blog.csdn.net/cstester/article/details/4758172 Chines ...
- bootstrap input框清空
<!DOCTYPE HTML> <html> <head> <link href="http://netdna.bootstrapcdn.com/t ...
- js 字符串拼接
正常来说已经使用es6 的 模板了如`` //页面层 layer.open({ type: 1, content:`<div class="child_card"> & ...
- # 20145334赵文豪 《Java程序设计》第7周学习总结
20145334赵文豪 <Java程序设计>第7周学习总结 教材学习内容总结 第十三章 时间与日期 13.1.1时间的度量 1.格林威治时间(GMT):参考太阳到达最高点,有时间误差. 2 ...
- Educational Codeforces Round 16 A B C E
做题太久也有点累了..难题不愿做 水题不愿敲..床上一躺一下午..离下一场div2还有点时间 正好有edu的不计分场 就做了一下玩玩了 D是个数学题 F是个AC自动机 都没看明白 留待以后补 A 给出 ...
- Bootstrap 轮播插件
一.轮播 //基本实例. <div id="myCarousel" class="carousel slide"> <ol class=&qu ...
- UIBezierPath用法
前言 笔者在写本篇文章之前,也没有系统学习过贝塞尔曲线,只是曾经某一次的需求需要使用到,才临时百度看了一看而且使用最基本的功能.现在总算有时间停下来好好研究研究这个神奇而伟大的贝塞尔先生! 笔者在学习 ...
- LightOj 1220 - Mysterious Bacteria (分解质因子x=b^p 中的 x 求最大的 p)
题目链接:http://lightoj.com/volume_showproblem.php?problem=1220 题意:已知 x=bp 中的 x 求最大的 p,其中 x b p 都为整数 x = ...
- Mybatis 与 spring mvc
本文是用来小结一下自己mybatis 和spring mvc 学习过程. 在写的过程中发现 http://www.phperz.com/article/15/0127/48684.html 这篇文章里 ...
- 详解php的curl几个函数
关于php的curl一系列函数,这里解释一下它们的作用. 在html中,我们可以通过form设置http的post和get提交,但假如我们获取的数据不是从html中来的,而是php脚本主动向其他服务器 ...