如何从 Windows 中的加密 OpenPGP 消息中删除版本信息?

如何从 Windows 中的加密 OpenPGP 消息中删除版本信息?

我在 Windows 8.1 上通过 Powershell 使用 Keybase.io 和 GnuPG。我想知道如何从加密和/或签名的消息中删除版本行。下面是我想要的示例:

-----BEGIN PGP MESSAGE----- 
Version: GnuPG v2  <-- **Remove this (line).**

owEBTQGy/pANAwACARsm2bqGdVliAcsdYgBUavgLVGVzdCBmb3IgU3RhY2tPdmVy
ZmxvdyCJARwEAAECAAYFAlRq+AsACgkQGybZuoZ1WWKlVgf/cfsU/aJYnNIimAwq
DKKfWox9c7rEC5ug6qcQzb5YFPsGuyMtZ1Tx9SwCmvU7IXtlnK/BY6H4ut50zOzl
8O8fYaaK63NupeEThlNK1fMvTmt56GLRSgGZ9yBOdkaC3A3SWBAsniPoj5wjBr7m
/MHnqs5Gw1Mtp8I8issZzTQXGjq4j6mAli1Vb3lBpESuF/s/uOxY8jSCV8SDH0UU
RxKoVnzqXd7mD2Dv+KE8K1PKVbVNyT+vIc+rOsRKkaW+6rSXVXie4DWkKxCP5RPe
3Ma3KMark71EwNW86IWryFm8YkP4vt31HKMwW4HUb6nhFF24IQOPle51YoiyZWUC
ejtY4Q==
=xKTQ

-----END PGP MESSAGE-----

另外,我发现了可以添加到选项中的选项,但我找不到选项文件本身(gpg.conf)。

答案1

在 Microsoft Windows 中,配置文件存储在%APPDATA%\gnupg对于较新版本的 Microsoft Windows,此目录默认存储在

C:\Users\%USERNAME%\AppData\Roaming\gnupg

可以通过编辑选项来更改注释字符串comment,或者完全删除选项。要删除版本,请添加一行包含no-emit-version不需要值的选项。从man gpg(所有非缩写的命令行选项都可以在不带--前缀的情况下使用gpg.conf):

--comment string
--no-comments
     Use  string  as  a comment string in clear text signatures and ASCII
     armored messages or keys (see --armor). The default behavior is not to
     use a comment string. --comment may be repeated multiple times to get
     multiple comment strings. --no-comments removes all comments.  It is a
     good idea to keep the length of  a  single  comment  below  60 characters
     to avoid problems with mail programs wrapping such lines.  Note that
     comment lines, like all other header lines, are not protected by the
     signature.

--emit-version
--no-emit-version
     Force inclusion of the version string in ASCII armored output.  If given
     once only the name of the program and the major number is emitted
     (default), given twice the minor is also emitted, given triple the micro
     is added, and given quad an operating system identification is also emitted.
     --no-emit-version disables the version line.

相关内容