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为了避开政府的 ...
随机推荐
- HttpSessionListener和HttpSessionBindingListener监听session的销毁
1. 使用HttpSessionListener public class OnlineUserListener implements HttpSessionListener { public voi ...
- request获取请求头和请求数据
package cn.itcast.request; import java.io.IOException; import java.io.InputStream; import java.io.Pr ...
- js中的text(),html() ,val()的区别
js中的text(),html() ,val()的区别 text(),html() ,val()三个方法用于html元素的存值和取值,但是他们各有特点,text()用于html元素文本内容的存取,ht ...
- 安装Arch Linux
参考自:https://wiki.archlinux.org/index.php/Main_Page_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87) 用fdisk建立分区 ...
- 如何正确使用css中vertical-align
首先明确,vertical-align只对inline-block和inline元素有效. 在说vertical-align之前,需要先说明一下什么是line box. 浏览器中显示的一行会包含多个非 ...
- SinalR+WebSocket
1.参考资料: http://www.asp.net/signalr/overview/guide-to-the-api/hubs-api-guide-server http://signalr.ne ...
- App 打包并跳过 AppStore 的发布下载
一.App 打包 (编译 -> 链接 -> 打包) 1) 下载发布版的证书并安装. 2)Target -> Build Setting,改为发布版本的 profile 3) Targ ...
- JS 获取 地址栏 参数
法一:正则表达式 /** * 采用正则表达式获取地址栏参数: **/ var GetQueryString = function (name) { var reg = new RegExp(" ...
- QMessageBox
#include "dialog.h" #include "ui_dialog.h" #include<QMessageBox> Dialog::D ...
- Oracle 参数之_small_table_threshold
SQL> select * from v$version; BANNER ------------------------------------------------------------ ...