JEP 130: SHA-224 Message Digests

JEP 130 (SHA-224 Message Digests) is one of the 11 new security features funded and targeted to JDK 8.

The SHA-2 cryptographic hash family includes the SHA-224, SHA-256, SHA-384, and SHA-512 algorithms. The JDK already includes support for SHA-256, SHA-384, and SHA-512. JEP 130 completes the JDK support for the SHA-2 family.

SHA-224 is basically a truncated version of SHA-256. The calculated hash is 224 bits (instead of 256) and is computed with a different initial value than SHA-256. It provides 112 bits of security (which is the same as two-key Triple DES). Use SHA-224 when your cryptographic application provides no more than 112 bits of security or you need the extra savings of the smaller hash size.

Here are some code examples using SHA-224:

// Create a SHA-224 java.security.MessageDigest
MessageDigest md = MessageDigest.getInstance(“SHA-224”);

// Create a SHA224withRSA java.security.Signature
Signature sig = Signature.getInstance(“SHA224withRSA”);
// Create a SHA224withECDSA java.security.Signature
Signature esig = Signature.getInstance(“SHA224withECDSA”);

// Create an HmacSHA224 javax.crypto.KeyGenerator
KeyGenerator kg = KeyGenerator.getInstance(“HmacSHA224”);

// Create an HmacSHA224 javax.crypto.Mac
Mac mac = Mac.getInstance(“HmacSHA224”);

// Create an RSA/ECB/OAEPWithSHA-224ANDMGF1PADDING javax.crypto.Cipher
Cipher c = Cipher.getInstance(“RSA/ECB/OAEPWithSHA-224ANDMGF1PADDING”);

Early access binaries of JDK 8 can be downloaded at http://jdk8.java.net/download.html

Comments:

What about SHA512/t support that was added in FIPS 186-4 ?

Posted by Darren Moffat on August 19, 2013 at 08:15 PM EDT #

We haven't added support for SHA-512/t in JDK 8, but I've added it to our list of things we should look at for JDK 9. SHA-512/256 and SHA-512/224 could also potentially be added to an 8 update release since no API changes are necessary.

Posted by Sean Mullan on August 26, 2013 at 03:44 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Sean Mullan

Search

Top Tags
Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today