Page 1 of 1

What's the hash prefixes for RIPEMD160

Posted: Thu Nov 15, 2018 6:07 am
by DaHuFa
I want Javacard to generate RSA signature. The MessageDigest algorithm is ripemd160, and padding algorithm is PKCS1. PKCS1 needs a T encoded by DER as its header. What's the T value of PKCS1 when MessageDigest algorithm is ripemd160? Or what's the hash prefixes for RIPEMD160?

Re: What's the hash prefixes for RIPEMD160

Posted: Thu Nov 15, 2018 10:22 pm
by wumindejia
OID value: 1.3.36.3.2.1

Re: What's the hash prefixes for RIPEMD160

Posted: Fri Nov 16, 2018 5:36 am
by BirdKing
- MD5: 0x30, 0x20, 0x30, 0x0C, 0x06, 0x08, 0x2A, 0x86,
- 0x48, 0x86, 0xF7, 0x0D, 0x02, 0x05, 0x05, 0x00,
- 0x04, 0x10
-
- RIPEMD-160: 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2B, 0x24,
- 0x03, 0x02, 0x01, 0x05, 0x00, 0x04, 0x14
-
- SHA-1: 0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0E,
- 0x03, 0x02, 0x1A, 0x05, 0x00, 0x04, 0x14
-
- SHA256: 0x30, 0x31, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
- 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x01, 0x05,
- 0x00, 0x04, 0x20
-
- SHA384: 0x30, 0x41, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
- 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x02, 0x05,
- 0x00, 0x04, 0x30
-
- SHA512: 0x30, 0x51, 0x30, 0x0d, 0x06, 0x09, 0x60, 0x86,
- 0x48, 0x01, 0x65, 0x03, 0x04, 0x02, 0x03, 0x05,
- 0x00, 0x04, 0x40

Re: What's the hash prefixes for RIPEMD160

Posted: Fri Nov 16, 2018 6:24 am
by happy123654
llowedDigests.put("MD2", "1.2.840.113549.2.2");
allowedDigests.put("MD-2", "1.2.840.113549.2.2");
allowedDigests.put("MD5", "1.2.840.113549.2.5");
allowedDigests.put("MD-5", "1.2.840.113549.2.5");
allowedDigests.put("SHA1", "1.3.14.3.2.26");
allowedDigests.put("SHA-1", "1.3.14.3.2.26");
allowedDigests.put("SHA224", "2.16.840.1.101.3.4.2.4");
allowedDigests.put("SHA-224", "2.16.840.1.101.3.4.2.4");
allowedDigests.put("SHA256", "2.16.840.1.101.3.4.2.1");
allowedDigests.put("SHA-256", "2.16.840.1.101.3.4.2.1");
allowedDigests.put("SHA384", "2.16.840.1.101.3.4.2.2");
allowedDigests.put("SHA-384", "2.16.840.1.101.3.4.2.2");
allowedDigests.put("SHA512", "2.16.840.1.101.3.4.2.3");
allowedDigests.put("SHA-512", "2.16.840.1.101.3.4.2.3");
allowedDigests.put("RIPEMD128", "1.3.36.3.2.2");
allowedDigests.put("RIPEMD-128", "1.3.36.3.2.2");
allowedDigests.put("RIPEMD160", "1.3.36.3.2.1");
allowedDigests.put("RIPEMD-160", "1.3.36.3.2.1");
allowedDigests.put("RIPEMD256", "1.3.36.3.2.3");
allowedDigests.put("RIPEMD-256", "1.3.36.3.2.3");
allowedDigests.put("GOST3411", "1.2.643.2.2.9")