gpgsafe - wrapper for gpg to protect against secret key attacks
Kurt Fitzner
kurt-fitzner@home.com
Mon Jul 2 02:24:01 2001
This message is in MIME format
--_=XFMail.1.5.0.Linux:20010701181501:1833=_
Content-Type: multipart/mixed;
boundary="_=XFMail.1.5.0.Linux:20010701181459:1833=_"
This message is in MIME format
--_=XFMail.1.5.0.Linux:20010701181459:1833=_
Content-Type: text/plain; charset=us-ascii
Hi all,
I don't know the group policy on file attachments. If this is a "Bad Thing"
then someone let me know, and I won't do it again.
Further to my idea about the signature verification of secret keys, I am
attaching a couple shell scripts - what I call 'gpgsafe'.
First, use 'updategpgsafe' to produce a signature of all your secret keys
(along with their associated public keys).
Then, you can use the 'gpgsafe' wrapper. What it does, is check your secret
keys (and their associated public keys) against this signature. If the
signature passes, then it simply passes control to gpg and passes all
command-line arguments to it. If the signature check fails, then it spits out
a warning and exits with an -1 return code.
The caveat to this, is you need to make SURE you use 'updategpgsafe' every
time you make any change to your secret keyring AND every time you --edit the
public keys associtated with your secret ones. If you do this, then (as far
as I know), this will protect you against secret-key modification attacks.
I have tested this on my system, and it works. Your mileage may vary. I am
handing this out for people to test and comment on. I would really appreciate
comments on the theory of operation of this wrapper from someone who is more
familliar with encryption theory than I.
Kurt
--_=XFMail.1.5.0.Linux:20010701181459:1833=_
Content-Disposition: attachment; filename="updategpgsafe"
Content-Transfer-Encoding: base64
Content-Description: updategpgsafe
Content-Type: application/octet-stream; name=updategpgsafe; SizeOnDisk=1040
IyEvYmluL3NoCiMKIyB1cGRhdGVncGdzYWZlIHYxLjAKIwojIGJ5IEt1cnQgRml0em5lciA8a2Zp
dHpuZXJAZXhjZWxjaWEuMnkubmV0PgojCiMgU2lnbiB5b3VyIEdudVBHIGtleSByaW5ncy4KIyBU
aGlzIGlzIGZvciB1c2Ugd2l0aCB0aGUgZ3Bnc2FmZSB3cmFwcGVyIHRvIGNvdW50ZXIgcG9zc2li
bGUKIyBhdHRhY2tzIGJhc2VkIG9uIG1vZGlmeWluZyB5b3Vy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ID4+ICRLRVlTRklMRQpkb25lCmdwZyAtYiAkS0VZU0ZJTEUKcm0g
LWYgJEtFWVNGSUxFCgo=
--_=XFMail.1.5.0.Linux:20010701181459:1833=_
Content-Disposition: attachment; filename="gpgsafe"
Content-Transfer-Encoding: base64
Content-Description: gpgsafe
Content-Type: application/octet-stream; name=gpgsafe; SizeOnDisk=2146
IyEvYmluL3NoCiMKIyBncGdzYWZlIHYxLjAKIwojIGJ5IEt1cnQgRml0em5lciA8a2ZpdHpuZXJA
ZXhjZWxjaWEuMnkubmV0PgojIAojIEdOVSBQcml2YWN5IEd1YXJkIHNlY3JldCBrZXlyaW5nIHNh
ZmV0eSBjaGVjayB3cmFwcGVyLgojCiMgVGhpcyBpcyBhIHdyYXBwZXIgZm9yIGdwZyB0aGF0IHBy
b3RlY3RzIHlvdXIgcHJpdmF0ZSBrZXlyaW5nIGFnYWluc3QgcG9zc2libGUKIyBhdHRhY2tzIGJh
c2VkIG9uIG1vZGlmeWluZyB5b3VyIHNlY3JldCBrZXkuICBUaGVzZSBhdHRhY2tzIGFyZSBhIHNv
cnQgb2YKIyAnVHJvamFuIEhvcnNlJyBhdHRhY2ssIHdoZXJlIHRoZSBhdHRhY2tlciBtb2RpZmll
cyB5b3VyIHByaXZhdGUga2V5LiAgSWYgeW91CiMgdGhlbiBzaWduIHNvbWUgdGV4dCB3aXRoIHRo
aXMga2V5LCB0aGVuIHRoZSByZXN1bHRpbmcgc2lnbmF0dXJlIGNhbiBidSB1c2VkCiMgdG8gb2J0
YWluIHlvdXIgb3JpZ2luYWwgcHJpdmF0ZSBrZXkuCiMKIyBTaW5jZSBhdHRhY2tlcnMgY2Fubm90
IHRoZW1zZWx2ZXMgcHJvZHVjZSBhIHNpZ25hdHVyZSwgZHVlIHRvIHRoZSBwYXNzcGhyYXNlCiMg
ZW5jcnlwdGlvbiwgaXQgbWVhbnMgdGhhdCBpZiB5b3UgcHJlc2lnbiB5b3VyIHNlY3JldCBrZXly
aW5nLCBhbG9uZy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
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
iQEcBAEBAwAGBQI7P70DAAoJEN366Kf2Ie2tQbsH/j67m19nvPoDp1UW3g8wujIr
qc2FZZXZkfdWOOOM4H1iJ5r2VMlevWyT/gu8Q93J8EqmlDgyXa61sN9MmTwksNOY
QPn9o6GtEjif2uL2mcduqT5sH0ryBCQasGiId4Imv2t3zkquuwm5O1X/VNDodfJv
3GCxqGiErayzIF9Ha9hAMkq5XqhZdxsUh4Py0RSmZdEm2GjulBh8kwBEQf1uPlkZ
0nhyVjGYM52Gm7q9+GsU6bDHmLXGO2IUtcGcwermwq0cO/rae+OO3LneGoMXY5ko
BJmhdVxOWslXun+otIdWoSLMtdwgMwGyzZC+2J8ddNkG8gBGplkIJf6XjowC+Zw=
=jZSv
-----END PGP SIGNATURE-----
--_=XFMail.1.5.0.Linux:20010701181501:1833=_--
End of MIME message