1

我正在为我的计算机安全课程建立一个实验室,而一步就是给我带来问题。 这里是任务。 这是我在第 11 步之前所做的所有工作。 这是第 11 步,我遇到了麻烦。

11.  Use gpg and your own private RSA key to digitally sign aes.key.asc.
Digital signature must be appendedto cipher and stored in
key_signed.txt

问题是当我执行以下命令时

gpg --sign -o key_signed.txt -a aes.key.asc

预期输出(按分配):

示例输出

我的输出看起来像这样:

root@bt:~/lab2# cat key_signed.txt 
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.4.10 (GNU/Linux)

owFl0l2I2wQAwPFe9+Vy3Hanc2woszsO3cy8Num37IZpkyZpk7Rp2iatTEibz/ba
pvlo0p4OPEFxgpuCHPOEMbhDkfPpThHFKQhyE5FxB3ObIuhAwSETwcncPcgGPvl/
/D//zo5t8/lH4PXKpjC8NDHygX+zPirK1nRLHkyLVoM9PD7x1L1SGE4ygQJeCNAY
xyE4dv8CFdm09G7n6QDecQp4oA9NR6ahUOAIzpSDlN5xvKMAoLEYjUQwgjW8Dl63
2girgLSjiyasQSEQUnSGBHNEYqBKBJ5xgyittmIxMdEX23aCK5YloNVqZgwiVnXp
nleudpOFrKOS4VmIAbNxvu+CTFQcGGXHLcj1aDHJtsR62KONBKVGzY6DWgYwSFCR
uqJ4kmIQ5CxPihZkcbJcEKJIsiLhrWK3LIAVZ5bvcnCiojIFOS/YkZQDd6l0xaiF
AJPCa5moZTWUVh9EaDetxtksbVJOJIFDZFvkbQKuZodSpFHKMPVKFgqlzSZKpXXZ
hijdsoEUVBOdODzMDVuxZqqDgVXdrYZ4zgkyTtMjI/WiiQsuR9swGs6jVC1YcglW
iIN2123CBaoKDHGP08iYgqkVXO0FkyBaqeFVsdELSyZLx3FKJfJ2wyCwZK6PyIZc
6pNefRaV0STSaAvlPpAv6kok35cLhBbSLTyL5aSEW7ZKDlwqixk8Ey+FwJzsdvRY
z2W6GI9ZEgGl9W4KroXUeNYBOnqeSGQHHDvweIblgskcj1JlIYkh6aHhSEKe0ayB
Ggl3zKGRSGl9WshRIS9sRxOOqeUlDUhKStNCLC3DGgOpQbZcNzhsm66d4mu2WeUb
sbYiK4UQBUVdEu1JmIDnpbAdVqP5ZtGtZcKAKkV4LRuuVsoUJzAQnCNls+jOzAAz
PbeiAvdFYgz6f6Wvjjy63Tfi9+3c4b8H2gfsHv9PPLZ3192drXNfn159e+fa+cdO
oSs/TI59863/l5W1z5bPPOfLH/yyCh64sfsvjZDetc+uDVen9p67dmHsqruAXXy/
5d9YKl7fton8+NF+y395Abk7svLV+WOfcovro0tHkat7tr7nrh8XPpw7+Ru0n89d
GEy99dON5uLnD792wtq6CF+7/Ypve+DI7BP2k7fihQcu828i1M2lE3Ppv/Hl9V2/
v+A486t3rpxS3qBPxzKPHN/x5+O+Q/b8sfk2v3HTe+ZSe9+tZw+vPr+nKLz8xZVD
L0rguL61oB+gJhdHT05MDt+5/c/PzYD2qzX+EsPpZ6b8370+t5x+sM7MPPTenU82
Ph4N7ftj/OBCBP0X
=ZfM8
-----END PGP MESSAGE-----

我想我只需要使用>>流重定向运算符将签名附加到加密中,但我尝试过的一切都不会导致以

-----BEGIN PGP SIGNATURE-----

怎么做才能得到预期的输出?

4

2 回答 2

2

查看您的预期输出,据我所知,作业要求您“清除签名”加密文件。所以试试这个命令:

gpg --clearsign -o key_signed.txt aes.key.asc

我发现这个很好的参考资料可能会有所帮助。如果您进行网络搜索,还有许多其他可用的。

于 2013-02-17T23:11:45.410 回答
2

看看 GnuPG 的--clearsign标志。从手册页:

   --clearsign
          Make a clear text signature.  The content in a clear text signature is read-
          able without any special software. OpenPGP software is only needed to verify
          the signature.  Clear text signatures may modify end-of-line whitespace  for
          platform  independence and are not intended to be reversible.  The key to be
          used for signing is chosen by default or can be set  with  the  --local-user
          and --default-key options.

使用此命令获得预期的输出:

gpg --clearsign -o key_signed.txt aes.key.asc
于 2013-02-17T23:15:20.497 回答