[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggested DER Prefixes



On 5/21/03 4:11 AM, "Imad R. Faiad" <matic@xxxxxxxxxxxxxx> wrote:

> PS Can someone clarify OpenPGP symmetric
> algorithm ID: 6 (DES/SK), I mean, what
> variant of the DES algorithm are we talking about.
> TIA
> 

DES/SK is being removed. Don't implemented it.

> //Double width SHA (SHA1x) experimental algorithm
> //Used In: PGP 5.x
> //OpenPGP Hash Algorithm ID: 04
> unsigned char const SHA1xDERprefix[] = {
> 0x30, /* Universal, Constructed, Sequence */
> 0x35, /* Length 53 (bytes following) */
> 0x30,  /* Universal, Constructed, Sequence */
> 0x09,  /* Length 9 bytes*/
> 0x04, /* Universal, Primitive, Octet string */
> 0x05, /*Length 5 bytes*/
>   0x53, 0x48, 0x41, 0x31, 0x78,  /*SHA1x*/
> 0x05,  /* Universal, Primitive, NULL */
> 0x00, /* Length 0 */
> 0x04, /* Universal, Primitive, Octet string */
> 0x28 /* Length 40 bytes = 320 bits*/
> /* 40 bytes SHA1x digest start here */
> };
> 

Double-width SHA was an experimental thing some people were using for wider
DSA, it was never widely implemented. Don't implement it.

> //HAVAL 5 pass, 160 bits (HAVAL-5-160)
> //OpenPGP Hash Algorithm ID: 07
> //Used in: PGP 2.6.3ia-multi04+
> unsigned char const HAVAL-5-160DERprefix[] = {
> 0x30, /* Universal, Constructed, Sequence */
> 0x27, /* Length 39 (bytes following) */
> 0x30,  /* Universal, Constructed, Sequence */
> 0x0f,  /* Length 15 bytes*/
> 0x04, /* Universal, Primitive, Octet string */
> 0x0B, /*Length 11 bytes*/
>   0x48, 0x41, 0x56, 0x41, 0x4C, 0x2D,
>   0x35, 0x2D, 0x31, 0x36, 0x30, /*HAVAL-5-160*/
> 0x05,  /* Universal, Primitive, NULL */
> 0x00, /* Length 0 */
> 0x04, /* Universal, Primitive, Octet string */
> 0x14 /* Length 20 bytes = 160 bits*/
> /* 20 bytes HAVAL-5-160 digest start here */
> };
> 
> //HAVAL 5 pass, 256 bits (HAVAL-5-256)
> //OpenPGP Hash Algorithm ID: None
> //Used in: PGP 2.6.3ia-multi04+
> //Hash Algorithm ID used: 11
> unsigned char const HAVAL-5-256DERprefix[] = {
> 0x30, /* Universal, Constructed, Sequence */
> 0x33, /* Length 51 (bytes following) */
> 0x30,  /* Universal, Constructed, Sequence */
> 0x0f,  /* Length 15 bytes*/
> 0x04, /* Universal, Primitive, Octet string */
> 0x0B, /*Length 11 bytes*/
>   0x48, 0x41, 0x56, 0x41, 0x4C, 0x2D,
>   0x35, 0x2D, 0x32, 0x35, 0x36, /*HAVAL-5-256*/
> 0x05,  /* Universal, Primitive, NULL */
> 0x00, /* Length 0 */
> 0x04, /* Universal, Primitive, Octet string */
> 0x20 /* Length 32 bytes = 256 bits*/
> /* 32 bytes HAVAL-5-256 digest start here */
> };

Haval is being removed. Don't bother.

Now that there are the wide SHAs, they are what you should be implementing.

    Jon