在现今到处钓鱼网站的时代,假如你和我一样想谨慎驶得万年船,不妨学会GPG验证 - 接地气解释就是通过加密数字签名从而验证此软件真伪,是否确切来源此项目的程序员之手 ( 本文仅针对苹果用户 👀 )

但验证前我们需要搭配一些工具:

准备:

  1. 下载homebrew

打开terminal 键入以下二行代码即可( 忽略$ 此意思为在terminal键入 )

$/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

可选$brew analytics off 选择不分享数据。

2. 安装gnupg

$ brew install gnupg

gnupg就是一个验证加密签名的工具

"GnuPG uses public-key cryptography so that users may communicate securely. In a public-key system, each user has a pair of keys consisting of a private key and a public key. A user's private key is kept secret; it need never be revealed. The public key may be given to anyone with whom the user wants to communicate. GnuPG uses a somewhat more sophisticated scheme in which a user has a primary keypair and then zero or more additional subordinate keypairs. The primary and subordinate keypairs are bundled to facilitate key management and the bundle can often be considered simply as one keypair."

接下来动手实操

说多无谓,动手最实际,接下来我用两个最常用的比特币桌面钱包为例,让大家跟着自己动手验证。‌( 一切从简,这里我们只使用terminal作练习 )

练习 A. Electrum Wallet

官方link的教程在这 guide

1. 下载此软件及其旁边签名。‌‌

将两者放在同一文件夹中,如下载文件夹。‌‌

2. 检查不同来源的fingerprint而从验证签名者的公钥。‌‌

Github‌‌

为导入PUBLIC KEY BLOCK,,运行gpg --import复制该块并粘贴到终端,然后按 CTRL+D 键。‌‌

Keyserver

This guide

再多做一步,确保导入的key正确无误:‌‌

$ gpg --fingerprint thomasv@electrum.org

所有fingerprint都吻合 6694 D8DE 7BE8 EE56 31BE  D950 2BD5 824B 7F94 70E6, 很好!

3. 验证已签名文件。

在terminal中输入以下两行代码

$ cd Downloads

$ gpg --verify electrum-4.5.3.dmg.asc

如你看到"gpg: WARNING: This key is not certified with a trusted signature!"这意味着你没有将此公钥标记为信任,那可以运行gpg --edit-key thomasv@electrum.org , 输入 trust 并选择信任度。

不妨再运行一次! ( 据我测试,如果想让这警告消失,需要将信任设置为 "5 = 我彻底信任"。)

现在可以优雅安装这软件了。

练习 B. Sparrow Wallet

以下是官方指南

1. 下载此软件、签名和二个额外文件。

将它们放在同一个文件夹中,如下载文件夹。‌‌

2. 查证不同来源的fingerprint而从验证签名者的公钥。‌‌

KeybaseGithubKeyserver

再多做一步,确保导入的key正确无误:‌‌

$ gpg --fingerprint craig@sparrowwallet.com

所有fingerprint均匹配: D4D0 D320 2FC0 6849 A257 B38D E946 1833 4C67 4B40 很好!

3. 验证已签名文件。‌‌

在terminal中输入以下两行代码

$ cd Downloads

$ gpg --verify sparrow-1.8.2-manifest.txt.asc

“ You have now verified the signature of the manifest file, which ensures integrity and authenticity of the manifest file - not the binaries!  ”现在您已经验证了manifest file的签名( 但不是 binaries)这确保了manifest file的完整性和真实性。

Sparrow的解释

4. Verify the hashes.

因为签名文件的名称与软件不同这意味着还需要做一个步骤;只需将以下代码复制并粘贴到terminal: shasum --check sparrow-1.8.2-manifest.txt --ignore-missing

现在可以优雅安装这软件了。

🕵🏼 验证的艺术‌‌

1. 下载软件及其signature.

将两者放在同一文件夹中,如下载文件夹。‌‌

2. 查证不同来源的fingerprint从而验证签名者的公钥。

可查看 Github、Keybase、KeyServer 和不同的社交网站;一般来说,显示相同密钥的来源越多,可信度就越高。‌‌

3. 验证已签名文件。

-- 如果签名文件名(asc)下载dmg文件名匹配,run以下代码:

$ gpg --verify {filename}.asc

-- 如果签名文件名(asc)与下载的 dmg 文件不匹配,获取 sha256 并run以下代码:

$ cd Downloads

$ echo "{hash}  {filename}" | shasum -a 256 -c -

恭喜!现在你已经学会了如何优雅验证两个最重要的比特币钱包!如果有任何问题或错误,不妨留言:)