有没有类似便携式 GnuPG 钥匙串的东西?

信息安全 pgp gnupg
2021-08-14 21:39:51

在不是我日常驱动程序的计算机上加密或解密文档时,我需要将我的密钥导入钥匙串,进行加密/解密,然后从计算机中删除钥匙串。作为一个考虑安全的人,我知道无论是否被索引,密钥仍然留在计算机上,因此可以恢复。

有没有办法将 GnuPG 钥匙串的所有功能封装在便携式 USB 记忆棒上。

这样,当您完成加密/解密时,您只需移除 USB。

就像 Yubico 棒一样,但打开了 GnuPG 私钥和公钥。

1个回答

OpenPGP 智能卡不存储公钥。您只能将它们与密钥的本地副本一起使用。因此,您无法使用各种 OpenPGP 智能卡,包括 YubiKeys 和 Nitrokeys,而不会在主机上留下痕迹。

您可以通过将整个 GnuPG 主目录移动到拇指驱动器上来使用 GnuPG 密钥环,并将--homedir选项设置为gpgGNUPGHOME环境变量。来自man gpg

   --homedir dir
          Set  the  name  of the home directory to dir. If this option is not
          used, the home directory defaults to ‘~/.gnupg’.  It is only recognized
          when given on the command line.
          It also overrides any home directory  stated  through  the  environment
          variable  ‘GNUPGHOME’  or  (on  Windows  systems)  by  means  of  the
          Registry  entry  HKCU\Soft‐ware\GNU\GnuPG:HomeDir.

您甚至可以使用 USB 拇指驱动器作为 GnuPG 主目录以及 YubiKey 来保存私钥,以便在(某种程度上)不受信任的机器上使用。

仍然要注意命令行历史记录、临时文件夹、系统日志中可能存在的痕迹……使用某些操作系统而不留下任何痕迹几乎是不可能的。