This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Security and the fly likes MAC differs 1.3 vs 1.4 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » Security
Bookmark "MAC differs 1.3 vs 1.4" Watch "MAC differs 1.3 vs 1.4" New topic
Author

MAC differs 1.3 vs 1.4

Marshall B Thompson
Ranch Hand

Joined: Apr 11, 2002
Posts: 42
I am creating an MD5 Message Authentication Code to exchange with a third-party application. I need to get the MD5 token for the url string I pass to them. When I use JDK 1.4.2.01 the third-party accepts my security token. However; when I use JDK 1.3.1.09 and the optional JCE 1.2.2, the token is different for the same string, and gets rejected by the third-party.

Here is my 1.4.2 code:




Here is my 1.3.1 code



The byte array produced by the following line:
byte[] digest = mac.doFinal(dataBytes);
is apparantly incorrect with 1.3.1, but okay with 1.4.2.
Can anyone help me with this?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: MAC differs 1.3 vs 1.4