Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: GnuPG: users

why is SHA1 used? How do I get SHA256 to be used?

 

 

First page Previous page 1 2 Next page Last page  View All GnuPG users RSS feed   Index | Next | Previous | View Threaded


wk at gnupg

Jul 11, 2012, 3:25 AM

Post #26 of 38 (261 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On Wed, 11 Jul 2012 07:56, rjh [at] sixdemonbag said:

> V5 discussions will not kick off in earnest until NIST announces the new
> hash standard, or so I've heard people from the working group say.

And even then it will take 5 years or so until it it has been deployed
widely. Even GnuPG 1.2 is still in use; despite that it has been
declared EOL ages ago.

The fingerprint and the special features building upon it
(e.g. revocation keys) are targets for an attack based on a SHA-1
*pre-image* attack. We need to analyze the possible problems and if
needed deploy workarounds for them. SHA-256 for signatures is already
in widespread use - thus I don't see a problem right now.

The real problem I see for GnuPG is that its maintenance is heavily
under-financed and the pool of volunteers, taking care of it, is quite
small. I am not sure whether PGP is in a better position; giving its
current owner.


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


smickson at hotmail

Jul 11, 2012, 5:38 AM

Post #27 of 38 (257 views)
Permalink
RE: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

> I'd much rather fail to generate a signature than generate
> one using an algorithm which is very weak.

My feelings as well.



Date: Tue, 10 Jul 2012 23:59:45 +0000
From: sandals [at] crustytoothpaste
To: gnupg-users [at] gnupg
Subject: Re: why is SHA1 used? How do I get SHA256 to be used?

On Tue, Jul 10, 2012 at 10:10:12AM -0400, Robert J. Hansen wrote:
> > SHA1 is no longer secure.
>
> At the present moment, SHA-1 is just fine. In the fairly near future,
> anywhere between six months to a few years, I expect this will change.
> But "SHA1 is no longer secure" is factually untrue, at least where
> OpenPGP is concerned.

SHA-1 is considered cryptographically broken. It does not provide the
level of security it claims. Practically, collisions can be generated
for 75 of the 80 rounds[0]. I hardly consider an algorithm this close
to a collision "just fine". There's no need to run screaming to the
exits, but a quick and orderly transition has been appropriate for some
time. The time to move to something else is ending soon.

> I don't recommend SHA-1 for new signatures, but if you have a choice
> between sending a SHA-1 message which your recipient can verify
> or a SHA-256 message which your recipient can't, well -- that math's
> pretty easy to do. SHA-1 isn't a good choice for new signatures, but
> it's a lot better than no signature.

I don't generate signatures with algorithms I consider insecure because
that leads to people being able to forge signatures in my name. If I
use MD5, even for one message, that allows a moderately determined
attacker to replay that signature on what is likely to become a fairly
large set of messages. I'd rather avoid that, thank you.

> > I'm not going to cater to people using really old versions,
> > especially when security is involved.
>
> The good news is that no one's asking you to. You're only being
> advised, "don't use --digest-algo SHA256, it's unwise and can break
> interoperability. Use --personal-digest-preferences SHA256 instead."
> This is the same advice that has been given by the GnuPG developers, by
> the Enigmail team, and by many other people within the community. It's
> a best-practices thing for GnuPG.

The question is, will GnuPG fall back to SHA-1 if it's not in my digest
preferences? I'd much rather fail to generate a signature than generate
one using an algorithm which is very weak.

[0] http://eprint.iacr.org/2011/641

--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187

_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


nicholas.cole at gmail

Jul 11, 2012, 1:55 PM

Post #28 of 38 (257 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On Wed, Jul 11, 2012 at 11:25 AM, Werner Koch <wk [at] gnupg> wrote:
> On Wed, 11 Jul 2012 07:56, rjh [at] sixdemonbag said:
>
>> V5 discussions will not kick off in earnest until NIST announces the new
>> hash standard, or so I've heard people from the working group say.
>
> And even then it will take 5 years or so until it it has been deployed
> widely. Even GnuPG 1.2 is still in use; despite that it has been
> declared EOL ages ago.
>
> The fingerprint and the special features building upon it
> (e.g. revocation keys) are targets for an attack based on a SHA-1
> *pre-image* attack. We need to analyze the possible problems and if
> needed deploy workarounds for them. SHA-256 for signatures is already
> in widespread use - thus I don't see a problem right now.
>
> The real problem I see for GnuPG is that its maintenance is heavily
> under-financed and the pool of volunteers, taking care of it, is quite
> small. I am not sure whether PGP is in a better position; giving its
> current owner.

A bleak but realistic assessment.

But one thing that might be helpful to explain is this: what needs to
be in the V5 key format aside from the change in fingerprint hash?
Aside from that issue, the V4 key format seems to have been resilient.
What are the other issues that need to be addressed?

Nicholas

_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


sandals at crustytoothpaste

Jul 11, 2012, 6:23 PM

Post #29 of 38 (257 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On Tue, Jul 10, 2012 at 08:15:32PM -0400, Robert J. Hansen wrote:
> There tends to be a lot of scaremongering in the world of crypto. I
> think it's generally wise to be careful in our declarations. It is
> enough to say SHA-1 is known to not meet its design specifications and
> that some fairly devastating attacks against it will likely be coming
> along in the near future. That's already a good enough reason to reduce
> our usage of and dependency upon SHA-1. There's no need to fearmonger
> about how the algorithm has already collapsed, because it hasn't.

I'm not saying it has collapsed. I'm saying that it has weaknesses, and
that the number and magnitude of the weaknesses continue to grow, and
that I think it is imprudent to use SHA-1. I would much rather people
make the move to something better now, because otherwise we'll all be
stuck with SHA-1 long after it's insecure, just like it's been with MD5.

> > Practically, collisions can be generated for 75 of the 80 rounds[0].
>
> Right now, only random collisions can be generated. That's not any use
> in forging a signature, which requires a preimage collision. A
> cryptographic break is not the same as a practical exploit.

It's an indication of weakness. I've seen lots of people that work with
crypto claim that we don't need larger margins of security. The cost of
computation is so small that I'd rather overdo it than regret my
decision later.

> > I don't generate signatures with algorithms I consider insecure
> > because that leads to people being able to forge signatures in my
> > name.
>
> Then you need to stop using OpenPGP altogether, because you're already
> generating SHA-1 signatures with your certificate which can be lifted
> and dropped onto new messages if/when a preimage attack is introduced
> against SHA-1.

Really? I'm pretty sure that I'm not generating SHA-1 signatures. This
is signed using SHA-512, SHA-384, or SHA-256. When I sign another key,
I use SHA-512. At least that's what I've configured GnuPG to do, and
I'd be very surprised if it did not, in fact, do that. If it is using
SHA-1, please report it to the list: it's a bug.

> Let me make this really clear: if you believe SHA-1 is insecure, you
> believe OpenPGP is insecure and you should stop using it. SHA-1 is
> hardwired into the OpenPGP spec in a few different places and, as of
> right now, cannot really be removed. The new V5 key format will almost
> certainly change this, but V5 won't be coming out for a good long while yet.

SHA-1, for my current key, is being used to generate my fingerprint.
It's being used in MDCs when I encrypt a message. And it's being used
instead of the default checksum for my private key. That's it.

Since my private key remains solely in my possession and is not subject
to tampering, what checksum is used is really irrelevant. Since I sign
my messages when I encrypt them, the MDC is essentially redundant, since
it would be apparent that they'd been tampered with. It is extremely
unlikely that an attacker would be able to tamper with the encrypted
message such that they could produce a valid, signed unencrypted
message.

And I'm personally not happy with the use of SHA-1 for the fingerprint,
but it'll have to do for a while. I wish we had chosen RIPEMD-160
instead. I feel it's a better, more conservative design.

> > If I use MD5, even for one message, that allows a moderately
> > determined attacker to replay that signature on what is likely to
> > become a fairly large set of messages. I'd rather avoid that, thank
> > you.
>
> You've *already done this*.

Really? Can you show an example?

> If you truly believe this, stop using OpenPGP.

Is my statement not true for MD5?

--
brian m. carlson / brian with sandals: Houston, Texas, US
+1 832 623 2791 | http://www.crustytoothpaste.net/~bmc | My opinion only
OpenPGP: RSA v4 4096b: 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
Attachments: signature.asc (0.82 KB)


vedaal.nistar at gmail

Jul 11, 2012, 8:13 PM

Post #30 of 38 (258 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 7/11/2012 9:23 PM, brian m. carlson wrote:

>>> If I use MD5, even for one message, that allows a moderately
>>> determined attacker to replay that signature on what is likely to
>>> become a fairly large set of messages. I'd rather avoid that, thank
>>> you.
>>
>> You've *already done this*.
>
> Really? Can you show an example?

If you *ever* signed a message with SHA1 and posted it publicly,
(maybe in the 'olden days' before any vulnerability in SHA1 was known)

then that signature could become a source for a forgery,
whenever SHA1 becomes broken enough.

(A clever, malicious attacker could backdate the clock,
and have a forgery of something you did in the past,
when you couldn't claim:

"Hey, that's an obvious forgery!
I'm on record as saying I would never use SHA1 to sign anything anymore!")


vedaal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (MingW32)
Comment: Acts of Kindness better the World, and protect the Soul
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBCAAGBQJP/kC7AAoJEFBvT6HTX7GGXV0P/jE4sQEIohwQ4s89wLRzLkji
//WimhWcxBvuzSW/uTNaMwG1QwkDA/nbYwa3VUMv3BXNFA9bRaiLSG0QKo/4INo3
PPUqlC3zIS7H7up5BxU2kKw7F45IIjkYuny7A5cZr/0wldyThe6OJrGhO7AjnIv9
YfHc5ztaG115ch7fF5S2SqX2ygsoAGromsfo/0OyAtQssmFIzuEsTpDNQgFjieh7
rVPIIqedITwpcV+BHH5QSETVjC0ZzERMokC/RaJ+Ta14IwHfpSv5cAkFoqTMouiA
oJxrGWROepnlD371gNZ/2dD1N76LBqGrxIMrc2ZbDI9UvM3GrAqv2aqNn0LOdfMz
t/JhGj1DGUeRyCgR2R4+TNY9L5yh+rq0/1oMGmzDg7D1x3uhJFWChDSY2cPc+r+x
xqjrsgEcQejcSOD0YaDSOTII/cMY6Xm8pB60GaVtw5uTAErO4aPlat977JhO97IF
CWHp9VwdbKl8BepiKhq8N4yyIA/1pDVtYQt2Ua3QSUJ4uNUiUGyhrypkLdViC/ws
9jj7Hb1J4f7bjko+gGi36r0OGHd6zBE+a1auV6tli3fBvss1BJ8lSNqUVPO/leqB
CNjNQNMF1GJnOqU4UvTT84KHnQBCHGWneS61a94YiOTyYQqs0BAYc2y/z6JaQY/u
JmW/+vlA5PAoKr0aRSKe
=8Ycl
-----END PGP SIGNATURE-----


_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


rjh at sixdemonbag

Jul 11, 2012, 8:36 PM

Post #31 of 38 (257 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On 7/11/2012 9:23 PM, brian m. carlson wrote:
> Really? I'm pretty sure that I'm not generating SHA-1 signatures.

This is not necessarily relevant.

Here's a thought experiment for you. Someone creates a DSA-1k key and
uses --cert-digest-algo SHA256 and --enable-dsa2. This creates 160-bit
truncated SHA256 hashes.

This person is at risk from a SHA-1 preimage collision, *despite the
fact they've never generated a single SHA-1 signature*.

All the attacker has to do is create a message which SHA-1s out to the
same value as the truncated SHA-256 of a legitimate message. At that
point, the forgery becomes possible.

I don't specifically know how you're using SHA-256. Nor do I especially
want to know. What I do know is that there are a surprising number of
ways a SHA-1 preimage attack can screw over even people who have never
used SHA-256.

Don't put too much faith in "if I switch to SHA-256 I don't need to
worry about the SHA-1 attacks." It's probably not true.
Attachments: signature.asc (0.18 KB)


rjh at sixdemonbag

Jul 11, 2012, 8:40 PM

Post #32 of 38 (258 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On 7/11/2012 11:36 PM, Robert J. Hansen wrote:
> want to know. What I do know is that there are a surprising number of
> ways a SHA-1 preimage attack can screw over even people who have never
> used SHA-256.

s/SHA-256/SHA-1/

Apologies for the typo.
Attachments: signature.asc (0.18 KB)


mailinglisten at hauke-laging

Jul 11, 2012, 9:09 PM

Post #33 of 38 (256 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

Am Mi 11.07.2012, 23:13:00 schrieb vedaal:
> (A clever, malicious attacker could backdate the clock,
> and have a forgery of something you did in the past,
> when you couldn't claim:
>
> "Hey, that's an obvious forgery!
> I'm on record as saying I would never use SHA1 to sign anything anymore!")

So what?

A signature over a broken hash alone is worthless no matter what its timestamp
says. If you want to prove anything by a signature at a time when the hash is
considered broken you have to prove that the signature existed before that
time. And this proof can obviously not be based on the broken hash.

Thus you have to sign all signatures you want to be able to use after the
announcement that they are broken (which can, of course, come surprisingly) by
another hash or rather you have to get them signed by a trusted third party if
you want to use them against someone.


Hauke
--
PGP: D44C 6A5B 71B0 427C CED3 025C BD7D 6D27 ECCB 5814
Attachments: signature.asc (0.54 KB)


dkg at fifthhorseman

Jul 11, 2012, 9:10 PM

Post #34 of 38 (256 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On 07/10/2012 06:15 PM, Robert J. Hansen wrote:
> Right now, only random collisions can be generated. That's not any use
> in forging a signature, which requires a preimage collision.

If the attacker can convince you to sign a chosen text (perhaps one that
looks reasonable), then a failure in the digest's collision-resistance
could very well be used to replay that signature over a different (but
colliding) text (which may not be something reasonable). This does not
require a preimage collision.

I'm not saying these attacks exist practically today against SHA1 (i
don't know if they do), but collision-resistance is the relevant
property, not resistance to pre-image attacks.

> SHA-1 is
> hardwired into the OpenPGP spec in a few different places and, as of
> right now, cannot really be removed.

The places where it is thoroughly "baked in" are the MDC (not relevant
cryptographically) and the V4 fingerprint (where the relevant property
is resistance to a preimage attack instead of resistance to generated
collisions.

>> If I use MD5, even for one message, that allows a moderately
>> determined attacker to replay that signature on what is likely to
>> become a fairly large set of messages. I'd rather avoid that, thank
>> you.
>
> You've *already done this*.

Where exactly has the original poster signed anything over an MD5 digest?

--dkg
Attachments: signature.asc (1.01 KB)


rjh at sixdemonbag

Jul 11, 2012, 9:33 PM

Post #35 of 38 (257 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

You're arguing two different contradictory things here:

> I'm not saying these attacks exist practically today against SHA1 (i
> don't know if they do), but collision-resistance is the relevant
> property, not resistance to pre-image attacks.

And then:

> The places where it is thoroughly "baked in" are the MDC (not relevant
> cryptographically) and the V4 fingerprint (where the relevant property
> is resistance to a preimage attack instead of resistance to generated
> collisions.

The relevant property can be resistance to preimage attack or it can be
collision resistance. Pick a property and argue it, please. :)

I am far more concerned about preimage attacks (which are the ultimate
game-over) than random collisions (which affect a smaller fraction of
the userbase). I'm not saying that random collisions are not troubling
in their own right.

> Where exactly has the original poster signed anything over an MD5 digest?

Refer to my subsequent message, where I backed off from that statement
and clarified I was referring to the poster was already relying on the
safety of SHA-1 -- and was just in denial about it.

If you believe SHA-1 is insecure and you want to avoid it at all costs,
you need to avoid OpenPGP.
Attachments: signature.asc (0.18 KB)


mailinglisten at hauke-laging

Jul 12, 2012, 5:05 AM

Post #36 of 38 (256 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

Am Mi 11.07.2012, 22:10:11 schrieb Daniel Kahn Gillmor:

> If the attacker can convince you to sign a chosen text (perhaps one that
> looks reasonable), then a failure in the digest's collision-resistance
> could very well be used to replay that signature over a different (but
> colliding) text (which may not be something reasonable). This does not
> require a preimage collision.

But that is a problem only in that case that a collision algorithm is capable
of creating (mostly – some "random" data may be hidden in comments) useful
data, isn't it?

I am not familiar with the collision algorithms. Is all the effort useless if
the reasonable document is slightly changed? I guess so. Does it make sense to
require every document which one is to sign to be slightly changed (even if
it's just a "typo" but this change would have to be determined by oneself not
by the other party) before signing?


> I'm not saying these attacks exist practically today against SHA1 (i
> don't know if they do), but collision-resistance is the relevant
> property, not resistance to pre-image attacks.

But the problem of collision-resistance can be addressed organizationally,
pre-image attacks cannot.


Hauke
--
PGP: D44C 6A5B 71B0 427C CED3 025C BD7D 6D27 ECCB 5814
Attachments: signature.asc (0.54 KB)


wk at gnupg

Jul 12, 2012, 7:16 AM

Post #37 of 38 (256 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On Wed, 11 Jul 2012 22:55, nicholas.cole [at] gmail said:

> But one thing that might be helpful to explain is this: what needs to
> be in the V5 key format aside from the change in fingerprint hash?
> Aside from that issue, the V4 key format seems to have been resilient.
> What are the other issues that need to be addressed?

We need to check the WG archives for a list. What I can remember are:

- A new fingerprint scheme

- A hard (non-changeable) expiration time

- A different way to express timestamps (Y2038 annoyance and the hard
Y2106 problem). An 8601 timestamp string should do.

- Get rid of the old and optional protection schemes or even switch to a
modern standard one.

There are related things we need to change for signatures packets. It
might also be a good time to replace PKCS#1.5,


Shalom-Salam,

Werner

--
Die Gedanken sind frei. Ausnahmen regelt ein Bundesgesetz.


_______________________________________________
Gnupg-users mailing list
Gnupg-users [at] gnupg
http://lists.gnupg.org/mailman/listinfo/gnupg-users


dkg at fifthhorseman

Jul 12, 2012, 9:59 AM

Post #38 of 38 (255 views)
Permalink
Re: why is SHA1 used? How do I get SHA256 to be used? [In reply to]

On 07/12/2012 08:16 AM, Werner Koch wrote:
> On Wed, 11 Jul 2012 22:55, nicholas.cole [at] gmail said:
>
>> But one thing that might be helpful to explain is this: what needs to
>> be in the V5 key format aside from the change in fingerprint hash?
>> Aside from that issue, the V4 key format seems to have been resilient.
>> What are the other issues that need to be addressed?
>
> We need to check the WG archives for a list. What I can remember are:
>
> - A new fingerprint scheme
>
> - A hard (non-changeable) expiration time
>
> - A different way to express timestamps (Y2038 annoyance and the hard
> Y2106 problem). An 8601 timestamp string should do.
>
> - Get rid of the old and optional protection schemes or even switch to a
> modern standard one.
>
> There are related things we need to change for signatures packets. It
> might also be a good time to replace PKCS#1.5,

some other points (from memory):

* Issuer subpacket should use a full fingerprint, rather than a short keyID

* designated revoker signature should embed full key instead of
fingerprint.

--dkg
Attachments: signature.asc (1.01 KB)

First page Previous page 1 2 Next page Last page  View All GnuPG users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.