MessageDigest hashes differently on different machines

前端 未结 2 1269
栀梦
栀梦 2021-02-02 01:56

I\'m having a problem with MessageDigest returning different hash values on different computers.

One computer is running 32-bit Java on Windows Vista and the other is ru

2条回答
  •  迷失自我
    2021-02-02 02:14

    Likely Jon Skeet's solution above is the cause, and his recommendations should definitely be taken into account, but another possible cause is a misunderstanding of salt.

    Salt is a semi-secret random value that is applied to a String prior to hashing. This makes it harder to perform a brute force attack when trying to guess what an originating String was because the salt is presumably unknown to the attacker.

    Salt values generally differ installation to installation. Its possible that the actual cause is just that you have the salt values set differently on the different machines.

提交回复
热议问题