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


0

我通过Powershell在Windows 8.1上使用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 )。

Answers:


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.

1
谢谢你,删除版本我只是添加这个 no-emit-version 在keyserver线之后,第4行?
user271360

1
忽略了你的评论,但版本信息。是的,你是对的,我编辑了我的答案。你添加行的地方无关紧要。
Jens Erat
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.