wood burning stoves 2.0*
The moose likes Features new in Java 7 and the fly likes Replace MD5 algorithm  for Java 7 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Features new in Java 7
Bookmark "Replace MD5 algorithm  for Java 7" Watch "Replace MD5 algorithm  for Java 7" New topic
Author

Replace MD5 algorithm for Java 7

suresh dhanapal
Ranch Hand

Joined: Aug 18, 2005
Posts: 37
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
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
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?


Ping & DNS - my free Android networking tools app
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5218
    
  12

I think MessageDigest is the class you are looking for


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
suresh dhanapal
Ranch Hand

Joined: Aug 18, 2005
Posts: 37
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
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
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

Joined: Aug 18, 2005
Posts: 37
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
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
Can you please answer my question?

I'm aware of that library - it contains no class of that name.
Mike Simmons
Ranch Hand

Joined: Mar 05, 2008
Posts: 3012
    
  10
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

Joined: Apr 06, 2010
Posts: 4371
    
    8

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

Joined: Aug 18, 2005
Posts: 37

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
Marshal

Joined: Mar 22, 2005
Posts: 41600
    
  55
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.
 
jQuery in Action, 2nd edition
 
subject: Replace MD5 algorithm for Java 7