开发者

MD5 checksums with salt

I thought that when salt is used, MD5 is computed from concatenation string + salt. So the word 'aaa' and salt 'aa' shou开发者_如何学JAVAld be the same like 'aaaa' with salt 'a' or 'aaaaa' without salt.

But this is what I got...

md5pass aaa aa

$1$aa$EeTKacbSboHIR0fSp2UVf0

md5pass aaaa a

$1$a$M2jh3iKJcBEuJdTGjNcsh0

Could you please explain why checksums are different?

Thank you,

Martin


I mixed up two different things - MD5 checksum and password hash

  1. MD5 checksum is used for checking that a file was not modified. No salt is used, result is usually a hexadecimal number.

  2. MD5 password hash is used to store passwords in non-readable form. It uses MD5(password + salt) in many iterations, result starts with $1$.

md5pass computes password hash from given passphrase and salt. There are many iterations of md5(pass + salt + result_from_previous_iteration) so not just MD5(pass+salt) as I thought.

http://en.wikipedia.org/wiki/Crypt_%28Unix%29

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜