Subject: [pkix] String Representation of SHA algorithms

From: Massimiliano Pala <[email-masked]>
Date: Mon, 09 Jul 2012 18:34:14 -0400

Dear PKIX,

I was wondering if there is an official document describing the string
identifiers associated to SHA algorithms, i.e. to identify an hash algorithm
should we use:

   SHA-1, SHA-256, SHA-384, SHA-512

or

   SHA1, SHA256, SHA384, SHA512

or

   sha1, sha256, sha384, sha512

(of course, this covers the case when you do not want to use OIDs)

RFC 4051 covers the case for full-blown URIs for algorithms, but is there
any document that covers what the string should be used ?

Cheers,
Max

-- 

tel.718-260-4009 | web: http://member.acm.org/~openca/

Massimiliano Pala, Ph.D.
Director & Founder, OpenCA Labs
Research Professor, NYU Poly
Assistant Director, CRISSP

http://crissp.poly.edu

---

From: Sean Turner <[email-masked]>
Date: Mon, 09 Jul 2012 18:45:56 -0400

There's an IANA registry for hash function textual names:

https://www.iana.org/assignments/hash-function-text-names/hash-function-text-names.xml

But, I've seen all three.  FIPS 180 uses SHA-*.

spt

>    SHA-1, SHA-256, SHA-384, SHA-512

or sha-1, sha-256, sha-384, sha-512 ;)

---

From: Massimiliano Pala <[email-masked]>
Date: Mon, 09 Jul 2012 19:54:12 -0400

Hi Sean,

thanks.. that's what I expected - it seems that there is no real "authoritative" source of 
information about
this issue - I see it could be useful in different scenarios (e.g., Sean Leonard's work on 
cert identifiers
or any environment where OIDs (and their text representations) are not particularly 
desirable).

Do you (list) think there is any utility for a small I-D (also informational) on the topic 
? It seems
a very small item, but it is potentially very useful (e.g., for URLs..).

Cheers,
Max

-- 

Massimiliano Pala, Ph.D.

http://crissp.poly.edu

---

From: [email-masked] (Martin Rex)
Date: Tue, 10 Jul 2012 05:29:11 +0200 (CEST)

Massimiliano Pala wrote:
>Sean Turner wrote:
> thanks.. that's what I expected - it seems that there is no real
> "authoritative" source of information about this issue - I see it
> could be useful in different scenarios (e.g., Sean Leonard's work on 
> cert identifiers or any environment where OIDs (and their text
> representations) are not particularly desirable).
> 
> Do you (list) think there is any utility for a small I-D
> (also informational) on the topic ? It seems

The situation is *MUCH* worse with dsa signature algorithms,
where from the list

dsaWithSHA1

dsaWithSHA224
dsaWithSHA256

the first one is an "illegal alien" (you need id_dsa_with_sha1 instead).

dsaWithSHA1       { 1, 3, 14, 3, 2, 27 }

dsaWithSHA224     { 2, 16, 840, 1, 101, 3, 4, 3, 1 }
dsaWithSHA256     { 2, 16, 840, 1, 101, 3, 4, 3, 2 }
id_dsa_with_sha1  { 1, 2, 840, 10040, 4, 3 }

-Martin

---

From: Sean Leonard <[email-masked]>
Date: Mon, 09 Jul 2012 21:58:25 -0700

Overall, the way that the hash algorithm is identified probably depends 
on the interplay between what the protocol supports and what the 
original authors intended.

NIST is very consistent in calling them "SHA-1", "SHA-256", "SHA-384", 
and "SHA-512" in FIPS 180-4 (as Sean pointed out).

In contrast, the Whirlpool hash algorithm is called "Whirlpool" by its 
creators, Vincent Rijmen and Paulo S.L.M. Barreto. Actually they call it 
<font color="#003377">W</font><font color="#003377" 
size="-1">HIRLPOOL</font> in the HTML, but in the metadata and in their 
publications, it's pretty clearly Whirlpool and not WHIRLPOOL.

Now that "SHA-512/256" is "official", one wonders what to do with the 
"/". My preference is to go with however the algorithm creators 
themselves call it, unless the protocol doesn't support it.

Just my 2¢,

Sean (L)

On 7/9/2012 4:54 PM, Massimiliano Pala wrote:
> "authoritative" source of information about
> this issue - I see it could be useful in different scenarios (e.g., 
> Sean Leonard's work on cert identifiers
> or any environment where OIDs (and their text representations) are not 
> particularly desirable).
>
> Do you (list) think there is any utility for a small I-D (also 
> informational) on the topic ? It seems

---

From: Sean Turner <[email-masked]>
Date: Tue, 10 Jul 2012 07:39:10 -0400

> themselves call it, unless the protocol doesn't support it.

I've been asking for an applicability statement of some kind on 
SHA-512/256 because I don't think they're we ought to really promote 
these as general purpose hashes.

spt

> _______________________________________________
> pkix mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/pkix
>

---

From: Stephen Kent <[email-masked]>
Date: Tue, 10 Jul 2012 10:49:46 -0400

>identifiers associated to SHA algorithms, i.e. to identify an hash algorithm

As you note later in your message, in PKIX we use OIDs, so I would 
not expect to find a standards for character string names for hash 
algs in any of our RFCs.  TLS and IKE use strings to specify algs, so 
maybe you should looks for IANA registries associated with those and 
similar security protocols.

Steve

---

From: Sean Leonard <[email-masked]>
Date: Tue, 10 Jul 2012 19:40:14 -0700

> these as general purpose hashes.

http://www.schneier.com/blog/archives/2011/02/nist_defines_ne.html

"They've done this because SHA-512 is faster than SHA-256 on 64-bit 
CPUs, so these new SHA variants will be faster."

As an aside, I intentionally omitted:
SHA-512/224 and SHA-512/256
SHA-3 (candidates)
Whirlpool
RIPEMD
[and everything else]

from this draft. If there is demand then I'll consider them, but I 
wanted to discourage the proliferation of identifiers.

-Sean

---

From: Phillip Hallam-Baker <[email-masked]>
Date: Wed, 11 Jul 2012 21:10:00 -0400

Should the JSON Signature folk be told to use the same registry?

(Says someone who just wrote code with their different identifiers this morning)

On Tue, Jul 10, 2012 at 7:39 AM, Sean Turner <[email-masked]> wrote:
> I've been asking for an applicability statement of some kind on SHA-512/256
> because I don't think they're we ought to really promote these as general
> purpose hashes.
>
> spt
>
>
>> Just my 2¢,
>>
>> Sean (L)
>>

-- 
Website: http://hallambaker.com/

---

From: Sean Turner <[email-masked]>
Date: Thu, 12 Jul 2012 10:01:59 -0400

I did ask about their names: HS256, HS384 ... the response was that 
these were to ensure a compact representation.  Note they also allow for 
use of the XMLDSig identifiers.

spt