Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Whirlpool Encryption
06-12-2012, 07:30 PM #1
- Join Date
- Apr 2011
- Thanked 2 Times in 2 Posts
So I have created a website in PHP which includes a blog. The website has an account system, and I am now trying to create a desktop application in java which will allow me to login and post into the blog.
The problem I have is with the encryption. The website uses a whirlpool hash and encryption, and I can't figure out how to duplicate the same in java. I have found a code on the internet which seems to have the functionality of creating the whirlpool hash, but I don't know which method to use to actually send it the password string and get back the hash.
Here is the PHP code that runs on my website:
return substr( str_pad( dechex( mt_rand() ), 8, '0', STR_PAD_LEFT ), -8 );
function getPasswordHash( $salt, $password )
return $salt . ( hash( 'whirlpool', $salt . $password ) );
function comparePassword( $password, $hash )
$salt = substr( $hash, 0, 8 );
return $hash == $this->getPasswordHash( $salt, $password );
getPasswordHash( $this->getPasswordSalt (), $password );
If anyone has any suggestions to solve the problem it'd be greatly appreciated!
06-12-2012, 07:47 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
Well, according to the tests in here:
I haven't a clue why the display method is private, but you can look at that to print a readable string if you need it for whatever reason.PHP Code:
Whirlpool w = new Whirlpool();
byte digest = new byte[Whirlpool.DIGESTBITS];