1

I have two projects. panager and panager-android. I use the whirlpool hash algorithm and with the same data panager gives different results than panager-android. panager is written in python and panager-android (guess) in java. I'm ultra-new in java so take it easy :P

In python I use a module that I found on the net (whirlpool.py) and in java I use the jacksum library.

tgies
  • 694
  • 4
  • 19
dzervas
  • 250
  • 2
  • 14
  • 3
    Have you taken other variables out of the equation by testing that your two implementations of Whirlpool return the same thing for absolutely known values? Compare the hashes computed for e.g. the empty string (""), and for some other non-empty test strings. – tgies Dec 29 '12 at 12:48
  • Could you provide a reproducible example- that is, a set of code using `whirlpool.py` and a set of code using `jacksum` that hash the same value and print the result, and report what each one prints? – David Robinson Dec 29 '12 at 12:55

1 Answers1

1

There are different versions of the Whirlpool spec which generate different output for the same input. It looks like whirlpool.py might be implementing the original Whirlpool (referred to as "Whirlpool-0"), whereas in panager-android you use Whirlpool-2:

AbstractChecksum encode = JacksumAPI.getChecksumInstance("whirlpool2");

Try changing that to "whirlpool0" and see if it matches your Python implementation now. Failing that, try "whirlpool1".

Wikipedia has known Whirlpool hashes from each version for a given test input which you may use to identify the version of a questioned Whirlpool implementation, or find out if it's just entirely wrong and broken.

tgies
  • 694
  • 4
  • 19