安全是生命的保障:用GPG加密使您的信息安全保障无忧二(图)来源: 发布时间:星期四, 2009年2月12日 浏览:22次 评论:0
导入公钥 作为用户 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 1.导入 比如 ![]() ![]() ![]() #gpg --import terry.gpg 2.核对“指纹” 公钥是可以伪造 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 生成Terry公钥 ![]() #gpg --fingerpr ![]() pub 1024D/7234E374 2004-09-10 Terry Yu (for test) <[email protected]> Key fingerpr ![]() 499D 805B 588E 82FB CD0F 7234 E374 sub 2048g/4907EA0A 2004-09-10 [expires: 2005-09-10] 这个“指纹”是惟 ![]() ![]() ![]() ![]() ![]() ![]() 3.签名 在成功导入 ![]() ![]() ![]() ![]() ![]() ![]() 对公钥进行签名可以使用如下命令: #gpg --sing-key [email protected] 或者 #gpg --edit-key name #command > sign 检查对方邮件 ![]() ![]() #gpg --check-sigs [email protected] 现在 ![]() ![]() ![]() ![]() 应用GPG GPG使用 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 非对称 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 简单了解这些密码学概念后 ![]() ![]() ![]() 对文件进行加密和数字签名 KDE中提供了图形化 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 对于图形方式 ![]() ![]() ![]() ![]() ![]() ![]() 1.对文件进行数字签名 #gpg --clearsign policy.txt You need a passphrase to unlock the secret key for user: "test (test) <[email protected]>" 1024-bit DSA key, ID ADD93830, created 2004-07-01 运行以上命令 ![]() ![]() ![]() ![]() ![]() 2.验证文件 ![]() #gpg --ver ![]() gpg: Signature made 2004年11月04日 星期 4 15时58分07秒 UTC using DSA key ID ADD93830 gpg: Good signature from "test (test) <[email protected]>" 以上命令运行 ![]() ![]() ![]() 3.用指定 ![]() #gpg --encrypt -r [email protected] report.txt gpg: checking the trustdb gpg: checking at depth 0 signed=0 ot(-/q/n/m/f/u)=0/0/0/0/0/1 gpg: next trustdb check due at 2005-09-10 运行以上命令 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 4.用私钥对加密文件解密 #gpg --decrypt report.txt.gpg >report.txt You need a passphrase to unlock the secret key for user: "test1 (un ![]() 2048-bit ELG-E key, ID 33735683, created 2004-09-29 ( ![]() gpg: encrypted with 2048-bit ELG-E key, ID 33735683, created 2004-09-29 "test1 (un ![]() 以上命令要求输入对应私钥 ![]() ![]() ![]() ![]() 5.用公钥同时进行文件签名和加密 #gpg -se -r [email protected] report.txt You need a passphrase to unlock the secret key for user: "test (test) <[email protected]>" 1024-bit DSA key, ID ADD93830, created 2004-07-01 以上命令要求输入对应私钥 ![]() ![]() ![]() ![]() ![]() 这些都是应用GPG签名和加密文件 ![]() ![]() ![]() ![]() ![]() ![]() 对电子邮件进行加密和数字签名 实际上 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Kmail是KDE环境中 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 其中 ![]() ![]() ![]() ![]() ![]() 保存后 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 发送邮件时 ![]() ![]() ![]() ![]() ![]() 正确输入保护口令后 ![]() ![]() ![]() ![]() ![]() 确认内容无误后 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 软件Software包签名验证 对于Red Hat等Linux发行商来说 ![]() ![]() ![]() ![]() ![]() ![]() ![]() 验证 ![]() ![]() 1.从网上或其它方式得到软件Software发行商 ![]() ![]() ![]() ![]() 2.通过对比“电子指纹”来确认公钥 ![]() ![]() 3.使用以下命令来验证软件Software包 ![]() #gpg --ver ![]() 如果该软件Software是RPM格式 ![]() ![]() #rpm -Kv your.rpm 密钥管理 前面介绍了GPG在加密和签名两方面 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ◆ 备份好私钥 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ◆ 建立有过期保护 ![]() 万 ![]() ![]() ![]() ◆ 为私钥加上强口令保护 这样 ![]() ![]() ![]() ![]() ![]() ![]() ![]() ◆ 多重机制 在紧急情况下恢复密钥要有多重控制 ![]() ◆ 使用版本控制软件Software 使用版本控制软件Software来收集和维护自己 ![]() ![]() ![]() ![]() ![]() 小结 GPG作为 ![]() ![]() ![]() ![]() ![]() ![]() 0
相关文章读者评论发表评论 |