Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MAC differs 1.3 vs 1.4

Marshall B Thompson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 the third-party accepts my security token. However; when I use JDK 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?
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic