EDIT : this answer is old. Usage of MD5 is now discouraged as it can easily be broken.
MD5 must be good enough for you I imagine? You can achieve it with MessageDigest.
MessageDigest.getInstance("MD5");
There are also other algorithms listed here.
And here's an third party version of it, if you really want: Fast MD5