Quantcast
Channel: Symantec Connect - Security - Discussions
Viewing all articles
Browse latest Browse all 203

PGP Command Line Email Sign and Encrypt

$
0
0
I need a solution

PGP Command Line 10.3.2 build 12316

Windows Server Preview build 10074

message.txt:

From: DEMO@GMAIL.COM
To: DEMO@GMAIL.COM
Subject: TEST

TEST

From PGP Command Line 10.3.2 User’s Guide ( https://support.symantec.com/en_US/article.DOC7066... ):

pgp --encrypt --email C:\data\message.txt --recipient jmedina@example.com --sign acameron@example.com --passphrase "a_cameron*1492sailedblue"
Encrypts the file message.txt to the public key associated with the email address jmedina@example.com and signs it with the private key associated with the email address acameron@example.com. The passphrase for the private key is supplied.

Butmy testfails, it seems encrypt is success, but sign is fail.

Microsoft Windows [Version 10.0.10074]
(c) 2015 Microsoft Corporation. All rights reserved.

D:\demo>pgp --list-keys
 Alg  Type Size/Type Flags   Key ID     User ID
----- ---- --------- ------- ---------- -------
*RSA4 pair 4096/4096 [VI---] 0x1234ABCD DEMO <DEMO@GMAIL.COM>
 RSA4 pub  2048      [VT---] 0xCA57AD7C PGP Global Directory Verification Key
2 keys found

D:\demo>pgp --encrypt --email message.txt --recipient DEMO@GMAIL.COM --sign DEMO@GMAIL.COM --passphrase "prEtr*kAbudaZafru7a4ramu5tufRASa"
message.txt:encrypt (0:output file message.txt.pgpmime)
DEMO@GMAIL.COM:encrypt (3104:could not read file, No such file or directory)
DEMO@GMAIL.COM:encrypt (3090:operation failed, file operation error)

MIME-Version: 1.0
From: DEMO@GMAIL.COM
To: DEMO@GMAIL.COM
Subject: TEST
X-PGP-Encoding-Format: MIME
X-PGP-Encoding-Version: 2.0.2
Content-Type: multipart/encrypted;
    boundary="PGP_Universal_15573F17_57097A5D_4B69C4F5_EF7C9739";
    protocol="application/pgp-encrypted"

--PGP_Universal_15573F17_57097A5D_4B69C4F5_EF7C9739
Content-Type: application/pgp-encrypted;
    x-mac-type=54455854;
    name=Version.txt
Content-Disposition: attachment; filename=Version.txt

Version: 1

--PGP_Universal_15573F17_57097A5D_4B69C4F5_EF7C9739
Content-Type: application/octet-stream;
    x-mac-type=70674546;
    name=Message.pgp
Content-Disposition: attachment; filename=Message.pgp

-----BEGIN PGP MESSAGE-----
Version: PGP SDK 4.2.1

qANQR1DBwUwDKiwXsXjmLeoBD/9f0tmohPvsYYduQj2g1ml6U3/Bdgt91OgSkMjT
bv0BiMWzx1AKTdvBPBu14SqdLjoej4iQAuoo7HkJXga9UAFLHa2SCFExWVBK6jbo
mPdw0wsGCNwISidAeVxgtnDmkK753GDci3qsM9muNgBRfm4acwyN/IbX8IuNpppw
B2yvx+WGiwuV7FLeih5ASihEOKEa5MsNl/Q969t2a3G4RYQ1A007xpM0Sf/qdwlA
XStbCA/2Urc/G8Rb0yBTsHqvS/b2xmG7OYCrFb2fko+8ZPu2w+jvkD2lhZdtihaF
+o8TMhgDN/UFadGsP+44ctAZZNMF6xqkouht9A3Y+E0X1ZpfJ/+x+9WhzpMcFmBc
bTLxcKY6tz0ttJfbsXhP/WYc5gziaRTJkySYxg+yfBy2HN5HpyQlAyMza2dHf7+W
t2XyjLq9yWRWnVLB6wv867u1lb4DSM4pJh8RMv3B4xv3XnkuySanxWBWCyNOdos1
+vW5ObwspbtaYIEncQCcNTyhC356J0y1CYZUxrBSjP3yQUDwtUUrx8bqitoskg9X
VSIyj5PPdFurhHjZL1KzQ9ZZP5t8fpAoN99odQbWpqpY9UanzJ9UAQu1m6gu5tlf
Wlf3qD3JALnzv2m3Y1wWaZ04quNa+WNnRsfeoPGASEyu6APz6vuK8CdMBCF0n1JU
RDEa59LBngFSQT4yI33riDCbusurcGBlFbo7MzYQLyUd0THy8eYrkFjic6Ng5tCF
BY7H29h5aM3r0/SSHN3K3EJldXTpZQbW6Fe7JzCVF7hxOX1bH5E5ridRDYsJzYe3
PnPJae3XQ6ohYkXsiy0XNTads3to4Yc2kkg9W25+/+STpqZn/zOWohPI+HJWGu0I
V3ArrnJ8Ar8lrAC5n9Egvqykc/x1gCV7Kb22PuyxzErAt2I3dthcvZ7ook4pi5K2
oBoT1vvsPEwRJO+90pSQ6Fa8yf9xrEeXbNwuwS2S0Unusa+AEO1DJuMncJGL3HV1
J7kf7zCgtzqIVPkprbcKIwhQroMa6z+CIWORuyMjfhyTSfWatJqGBTaABo7bOU0W
jQaKevFyg/7NNKP2t5fdQv1lTDawJK3oC02y2B6yuJ/yqhkAPEDOLq+NmH/z2U8v
e1NZQy7yHsDkZ0ONO+0uMbpCExiv675ChN1ZksPztK9QTaB8dO5epufRpc+uxJ+E
7jHQAlo8HdrMxkublOlAJxxBg2LWZgkPRHsi28ui0EzMl5QQmCwIjQxme+abZc5W
YlXZkmBYCNjOKEzXWdyR1tUVriY9sKasyk8F9rUFePW+/V2vvvgobWqxOUxKPnd0
3yY7yRSYx3WkRqm6TcedOzbeFRuazOMoE3OfkJWLWdCItoheIepautkKG0qjntZ9
5j2/G9262P6ze4fVDJSGa48uNgPbTpJQyhPXEjGz167RXkTUhGp93FF/BaHWaisu
uJgKoML8DAm6FMlExRcZDuYf+SgENQWFZhEPLRB53ZPB97PVsg==
=88yv
-----END PGP MESSAGE-----

--PGP_Universal_15573F17_57097A5D_4B69C4F5_EF7C9739--

D:\demo>pgp --decrypt --email message.txt.pgpmime --annotate --passphrase "prEtr*kAbudaZafru7a4ramu5tufRASa" --output decrypted.message.txt
message.txt.pgpmime:decrypt (0:output file decrypted.message.txt)

From: DEMO@GMAIL.COM
To: DEMO@GMAIL.COM
Subject: TEST
X-PGP-Universal-Decrypted: TRUE

* PGP Signed: 06/02/15 at 13:43:13, Decrypted

TEST

* DEMO <DEMO@GMAIL.COM>
* 0x1234ABCD

D:\demo>pgp --verify --email message.txt.pgpmime --annotate --passphrase "prEtr*kAbudaZafru7a4ramu5tufRASa"
message.txt.pgpmime:verify (3093:data is encrypted to subkey ID 0xABCD1234)
message.txt.pgpmime:verify (3044:subkey ID 0xABCD1234 belongs to 0x1234ABCD DEMO <DEMO@GMAIL.COM>)
message.txt.pgpmime:verify (3090:operation failed, bad passphrase)

then i try sign only:

D:\demo>pgp --email message.txt --sign DEMO@GMAIL.COM --passphrase "prEtr*kAbudaZafru7a4ramu5tufRASa"
message.txt:sign (0:output file message.txt.pgpmime)
DEMO@GMAIL.COM:sign (3104:could not read file, No such file or directory)
DEMO@GMAIL.COM:sign (3090:operation failed, file operation error)

MIME-Version: 1.0
From: DEMO@GMAIL.COM
To: DEMO@GMAIL.COM
Subject: TEST
X-PGP-Encoding-Format: MIME
X-PGP-Encoding-Version: 2.0.2
Content-Type: multipart/signed;
    boundary="PGP_Universal_C9FBF196_EFA0BB41_0D611BC9_EF4B0B4D";
    protocol="application/pgp-signature";
    micalg="pgp-sha256"

--PGP_Universal_C9FBF196_EFA0BB41_0D611BC9_EF4B0B4D

TEST
--PGP_Universal_C9FBF196_EFA0BB41_0D611BC9_EF4B0B4D
Content-Type: application/pgp-signature;
    x-mac-type=70674453;
    name=PGP.sig
Content-Disposition: attachment; filename=PGP.sig

-----BEGIN PGP SIGNATURE-----
Version: PGP SDK 4.2.1

iQIVAwUBVW1Hp6hXpJo6KSYcAQg1QRAAmGraDJwo98105VOqWxHRX7rtodq5Iaqr
T5bsDtL9gcNRsqd/39D3YxeGkG1t2mPQM//AebbQ0dtx8LW4hQhiroIS1OP8u7aF
GInYvAD7yaK9RbRbn05TSt0zmaikemZbzl9CQdsX9s6J5s55XNrsOEb1QgCGtF+e
w3nOPcuQNf+zj+P418k1m+dZ17qVTKiuY7In/QydwjhQWKzE5nfFh/zwnAQBpJqQ
n1pLGgZ0QRnjysYpX6rnGWrIEqiyhtgncMQMpLpc3K1Qe+4VMBrc7baBLQf+oawu
e7zIyGMQnfWzkBhABlZwWQiDO/L0uv+dLQHGuiQjxY+6cWeU/F32D89XgMb45KHP
az68Cq8nX/mSkPTXOOhxSDJfTRXfkE1E55HHbHwXGj87gks0DNdz2habzR4Jue8y
ibnUio4OK4JGr1nVesXPTiWs8D5pzp8n+INxP0QiXYJnideexQbn8QAi5eDlHKtQ
TI6njy7OjjJCpSNLUc4dNFvzN0/nN7GRMSMG8R9coUSXAEKhAxGjDNkJZGegz2WU
n9yvYT8DJIeOi6H1BAn7NJWbc0HzdGHMrsKLe9VkXw8ghe6RVj1h6Rg0SH6BIubL
Z6ZDFF0TxyTI7QL9ptnSUpFkZQwzOXotKGexuv/tOOrMBHLp4gEqvWYoP6I2bInf
+6k9FevsX3I=
=abTd
-----END PGP SIGNATURE-----

--PGP_Universal_C9FBF196_EFA0BB41_0D611BC9_EF4B0B4D--

no output when verify:

D:\demo>pgp --verify --email message.txt.pgpmime --annotate --passphrase "prEtr*kAbudaZafru7a4ramu5tufRASa"

Am I doing something wrong?


Viewing all articles
Browse latest Browse all 203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>