• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Replace MD5 algorithm for Java 7

 
suresh dhanapal
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MD5 algorithm is not compatible with Java 7 .I want to replace MD5 to any other latest algorithm for Java 7. Please suggest for new java class to supports this

sample existing code

[/code][/code]
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
MD5 is a standard algorithm that hasn't changed since 1991, and it's been supported by Java since version 1.0. What do you mean by "not compatible with Java 7"? Also, what is "HTTPClient.MD5"? Can't you just use the implementation that's built into the JRE class libraries instead?
 
Roel De Nijs
Sheriff
Posts: 10591
140
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think MessageDigest is the class you are looking for
 
suresh dhanapal
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using httpclient-4.3.3.jar

to use this, previously I used JDeveloper 11(JDK 6), now I upgraded to JDeveloper 12(JDK 7)

getting below error
Error(3,18): package HTTPClient does not exist
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not sure where that class comes from; it seems obscure. So:
Can't you just use the implementation that's built into the JRE class libraries instead?
 
suresh dhanapal
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
here is the information
http://hc.apache.org/httpcomponents-client-4.2.x/index.html

My issue is , after JDeveloper upgrade from 11 to 12, it does'nt work
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you please answer my question?

I'm aware of that library - it contains no class of that name.
 
Mike Simmons
Ranch Hand
Posts: 3090
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess it's probably from this library. The specific class can be found here. It's an undocumented package-private class project last updated in 2001, with a very poorly-named package that causes unnecessary confusion. I would think the original poster would be much better off with something of a more recent vintage, something actively maintained and used by people. Like the library he linked to, but isn't actually using.
 
Matthew Brown
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the use is security related, then you should move away from MD5 anyway, because it's considered insecure nowadays. Use something like the SHA family instead: again, using the standard libraries.
 
suresh dhanapal
Ranch Hand
Posts: 40
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

https://hc.apache.org/httpclient-3.x/news.html

Actual code used initially with JDeveloper 11



I have upgraded to JDeveloper 12, which as JDK 7,getting error.I have used both old and latest httpclient jar, still it doesn't work with JDeveloper.
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you're missing the point: you should use Java's built-in facilities, not same long-obsolete 3rd party library: http://www.jguru.com/faq/view.jsp?EID=3822

And yes, MD5 is obsolete, you should move to SHA-2 (or SHA-256, SHA-384 and SHA-512 as they're called in the Java world) instead.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic