undefined
undefined
Separation of messages signed and encrypted with DH keys,
into free-standing verifiable clearsigned messages
in order to decrypt and verify the messages below,
it is necessary to have the two DH keypairs used:
the signing keypair is 'DHsender', here:
-----BEGIN PGP PRIVATE KEY BLOCK-----
Version: 6.5.8ckt http://www.ipgpp.com/
Comment: passphrase: DHsender
lQHPBD9Y8j4RBADTbcoJERPj4hhKQDG1Dued4hElmINIcNsi9hbEQ/HFayygv9yR
Y23s/7KjdCT4a3Io2cTKtKyacqFcrjpi6eFRHn9SRxHdFGvXCV/cFv3oK4aTQtCK
WhrZ+aJ/PkbwafM7/0TjBtfkUpBlhGX7lAlfVO7S6kmUtz+YyTJea07ZcQCg/w/V
GQ4S1N+/tyIvwATPLMhSiWcEAKq6YY8yNlABVLMygWENMVehKa6TN00NBS3e42My
euAuMznwlUBo5RVHJvdeAr+eEVMxu+pbAt1OdqOcaq0P1TxCWu9XPHL6ZaF1vs8V
vEL7ajTq9tiKDHpsgi3nDmQzb40o2fZhkrv3/ddB8px/vDBrI4/VQvwhmeaoSJx0
iQXNBADHCBd+xq6Ku8OTm5hxazsVOaSgZzqAY9PLPqUDXAoEw8f1YXM3RaoiJK01
Pv1KEXk5K2+VY54DAIwpiIuvwZnWrGEfWNO69xzOuXjOFjXnWAP1fe04XBqr2ces
dgzUA+L4ubS9uePYmTTt3rd0mTxYZgKep5aS0AzfPQRYhPyRMv8CAwKoVKO9U1sX
lmBR+DThhuQQTL2It55ffbH185FpKPk6zE/x/19/pMuJbLQcREhzZW5kZXIgPERI
c2VuZGVyQGtleS50ZXN0Pp0CUQQ/WPJ6EAgA5ujznmdBch85z29uGwEI4zEcCTIk
K56bv+X+SGPewgnlLN3TYCFGzziuwBZNDaV5ggSKzLpVo2yJjtP0VcwMoT8fpzfE
Z5ALxc/mhBmSLRGe2BEpfI8vRTZjgvczCy4LsuAubVR24L6XXpaRIKfWAQSAiV0Z
D3MoUS20mhbb7EgHDVF264+wDbb+IAC6aO9v4YPz3RfTDbJHUi8Tq/cvPQGxiFRO
+PjajbVURBkq2q2CWHGoLnM2mNHgYyxkPKUj6+9P1g4FwcavgQ0aprr/2eXYJLiD
20b9baybYVfVCOe5aLWFPqbax/e7o6Mu0z/AeCeVmNKkG/D0YhW0cpVtUQACAgf8
DY8UOZTmOczaP2gNTbFDO8ewvSevxwgy7VaxXEFfhh7qChoC3Qqxw+sfrLPS4WHW
bdyKjugZe70pew4YXXxrR4sPiGzoaptMElkKIzHc1o2y+aaaX44380cAtWWmL4++
mwudueayjP4AynUAaIVDI/qjAbazKlo8Wwy4vCi7H+GDGi+OS1lkYaAejFGaQ0Gu
hFJgeY8rQ2RcjmXNKclJkoP/Nzv3eZIcT0Ist1MsD+r3OZoNrdPf3AR1cQ5dmSt+
+ro1EEHXMG3zXj0GmvguTmgxjRyDgZqqLXFZoJDdZUZ5h1OkYQe0INCWw9hNT6MV
ENi0iBhfaFhT8MWq3x2GR/8CAwLD+cx4kSk32WCLItQPb/+YfuOq8C/oEA94mQBi
V8ULyX6IeNAbMqNNKB3k6LUEGF2kNyr/GxQ87stVaEhvXdPR
=HYE+
-----END PGP PRIVATE KEY BLOCK-----
-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: 6.5.8ckt http://www.ipgpp.com/
Comment: Acts of Kindness better the World, and protect the Soul
mQGiBD9Y8j4RBADTbcoJERPj4hhKQDG1Dued4hElmINIcNsi9hbEQ/HFayygv9yR
Y23s/7KjdCT4a3Io2cTKtKyacqFcrjpi6eFRHn9SRxHdFGvXCV/cFv3oK4aTQtCK
WhrZ+aJ/PkbwafM7/0TjBtfkUpBlhGX7lAlfVO7S6kmUtz+YyTJea07ZcQCg/w/V
GQ4S1N+/tyIvwATPLMhSiWcEAKq6YY8yNlABVLMygWENMVehKa6TN00NBS3e42My
euAuMznwlUBo5RVHJvdeAr+eEVMxu+pbAt1OdqOcaq0P1TxCWu9XPHL6ZaF1vs8V
vEL7ajTq9tiKDHpsgi3nDmQzb40o2fZhkrv3/ddB8px/vDBrI4/VQvwh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AGBQI/WPJ6AAoJEKSdeB7/ngUAQcAAoMaTI2ZHxLGJ
nY9PQkQTtqSXApb4AKDdV+6w9N6GxT2gStuOmbVIC8USzg==
=4zuH
-----END PGP PUBLIC KEY BLOCK-----
{ the boo key is here:
https://www.angelfire.com/pr/pgpf/bookey.html}
Now, the original signed and encrypted file; fc1.txt
-----BEGIN PGP MESSAGE-----
Version: GnuPG v1.2.2-nr2 (Windows 98)
Comment: signed by DHsender, encrypted to boo
hQEOA9kZp67w50lIEAQAoPHeBoPu78vQojLY8hsoYrw2lZiBwskGQ9Bwzo1rjRPt
8UiY+rMgNBAUSsoCLuIvGFLXlB+tuE/2i2bGcnOIgx+9I6NDuLDsY8rOi81dzI+0
xogXh5Vc0qMiRnlTbDQ7r5/36AtobYqoF0FLLgfiB6LxzINKkaOQk8x/vbiyZdAE
AJhjuZmXHVaj/kuodOGzBRvcvecRrtP4e+UrofGC5o1gpod2jnzKdFiL9p8r78vP
gNfVv0bTOLr5j45C+LSkKfv1vB3sMkptCYNOS6UNSzriO1RjrIM/NM9/tD8MhICT
CRWhCegztfZs+eHbRNU0ARqBFZ/Bau/asL1dXigShHcg0qoBb6LIp194T/QMkduv
lXbzDTxfND0qLJXlkV95eu3P++Lh7r/zOliIVbu7Ko7jgTyAFkYFHYuU7hs3k/Gr
iZa1jt2I1T8BgYpzxvMCJI1rwvePt2fj4kj/yHTWytz0ugG9aoEEjIw7bg0SDqkb
MFpn6pWI5OEj0+jCSXcf2yuSclHnnMh3T5HWoI3NSMCEOVAMnvCsLI6lwEiIRo8b
XxJUUJgUJjxMVRe6ag==
=ce9d
-----END PGP MESSAGE-----
Now for the filecrypt commands,
(the filecrypt configuration file is set to 'verbose=2'
to provide the maximal amount of information of what filecrypt is doing)
first, importing the keys:
D:\filecrypt>filecrypt -ka i:\dhsender.asc
FileCrypt will use the configuration file located in the same
directory as the FileCrypt application.
** Your default public key ring is not set, use default setting.
** Your default secret key ring is not set, use default setting.
FileCrypt Desktop
Version 1.3
Copyright 2001-2003 Veridis, sa.
** The licence file has not been found.
** A file called "licence.asc" should be located in the
** C:\WINDOWS\filecrypt\ directory.
** FileCrypt will now run in demo mode:
** key generation will be limited to key of 512 bits length.
** The armor comment and version strings cannot be modified.
** After evaluating this software, you may purchase a
** licence at http://www.veridis.com/filecrypt. Thank you.
* FIPS continuous random number generator test enabled.
* FIPS power-up tests disabled.
Looking for new keys...
Type bits keyID date user ID
DSS 2048/1024 0xFF9E0500 2003/09/05 DHsender
Keyfile contains:
2 new key(s)
* Adding key "DHsender " [0xFF9E0500]...
* Key "DHsender " has been added.
* Key "DHsender " has been added.
Recalculating keys validity...
{after doing the same for the boo key, and importing it to filecrypt,
we are ready for the next step,
decrypting and separating the signature:}
Here are the filecrypt commands and outputs:
D:\filecrypt>filecrypt -b d:\fc1.txt
Packet found: 1 -- Public-Key Encrytped Session Key Packet
size=270
Packet found: 18 -- Sym. Encrypted and Integrity Protected Data Packet
size=170
* This message is encrypted for the following keys:
boo [0x7B534E2D]
Enter the passphrase of one of the keys listed above:
Keys used to decrypt this message:
boo [0x7B534E2D]
* Conventional algorithm used to decrypt this message: DES3
** This algorithm is not present in the preferred algorithms
** of the key used to decrypt this message.
Packet found: 8 -- Compressed Data Packet
size=-1
Packet found: 4 -- One-Pass Signature Packet
size=13
File 'd:\fc1.txt' has signature, public key is required to check signature.
Packet found: 11 -- Literal Data Packet
size=57
File was encoded as binary data
File timestamp: 2003/09/22 14:28:04
Decoding file...
Packet found: 2 -- Signature Packet
size=63
This message has been signed by "DHsender " (id=0xFF9E0500)
Signature made on 2003/09/22 14:28:04
Good signature
File 'd:\fc1.sig' contains the signature.
{the original decrypted plaintext is saved by filecrypt as
d:\fc1 without an extension, just as in pgp2.x,
but isn't listed specifically in the filecrypt output,
even under the highest 'verbose' setting}
here is the d:\fc1.sig separated signature as saved by filecrypt,
already in armored form:
-----BEGIN PGP SIGNATURE-----
Version: FileCrypt 1.3
Comment: Unregistered version. For evaluation purpose only
iD8DBQA/bz80pJ14Hv+eBQARAwKBAKC9pn7pBN9yV0tNKoUh2zN2IVeGRwCgq3hW
hSjBeIZ7eO9Ei3YOXn8D9NU=
=w/wL
-----END PGP SIGNATURE-----
now generate a reference clearsigned message to use as a template:
{here it is important to know how the original signed and encrypted message was done,
if it was done from gnupg, or a pgp commandline,
then there will be no space between the last line of the message,
and the beginning of the signature block,
(unless a blank line is put there intentionally before signing,
as some people [you know who you are ;-) ] are in the habit of doing,
and then removing the version line, so that it is not readily determinable
which pgp implementation was used)
if done from non-commandline pgp, it will have a blank line there.
since the header of the original signed and encrypted pgp message was done in gnupg,
the reference clearsigned message here will also be in gnupg.
here is the reference clearsigned message:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
reference clearsigned message
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-nr2 (Windows 98)
Comment: Acts of Kindness better the World, and protect the Soul
iD8DBQE/b1hT8kbh+ntTTi0RA+LlAKCn5ZQxqTJhabNblmI6ubPb0gfipQCfWWj5
hftGteEtpjodlzctlLjHTPo=
=CyEd
-----END PGP SIGNATURE-----
ok,
now replace the plaintext of the template with the plaintext from d:\fc1
and replace the signature block of the template,
with the signature block from d:\fc1.sig
(leaving all the headers and footers intact),
and the resultant composite, [with a *bad* signature], is here:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
filecrypt separation test for dh keys
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-nr2 (Windows 98)
Comment: Acts of Kindness better the World, and protect the Soul
iD8DBQA/bz80pJ14Hv+eBQARAwKBAKC9pn7pBN9yV0tNKoUh2zN2IVeGRwCgq3hW
hSjBeIZ7eO9Ei3YOXn8D9NU=
=w/wL
-----END PGP SIGNATURE-----
*but*
if an extra blank line is added between the end of the text, and the signature header, then it *does* verify:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160
filecrypt separation test for dh keys
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2-nr2 (Windows 98)
Comment: Acts of Kindness better the World, and protect the Soul
iD8DBQA/bz80pJ14Hv+eBQARAwKBAKC9pn7pBN9yV0tNKoUh2zN2IVeGRwCgq3hW
hSjBeIZ7eO9Ei3YOXn8D9NU=
=w/wL
-----END PGP SIGNATURE-----
(a quirk in filecrypt?
but in any event, undetectable if the original message
were done in non-commandline pgp,)