ad 16byte size in md5

时间:2016-07-05 22:08:49

标签: encryption cryptography aes

我试图了解一些代码

The 32-byte AES encryption key and the 16-byte IV are both derived from   the password and the salt like so:
salted = password . salt     # . is the concatenation of the two
key1   = md5(salted)         # key1 is 16 bytes long
key2   = md5(key1 . salted)  # key2 is 16 bytes long
iv     = md5(key2 . salted)  # this is the 16-byte IV
aeskey = key1 . key2         # this is the 32-byte AES key

md5(salted)如何可以是16个字节?即使md5是32字节?

1 个答案:

答案 0 :(得分:1)

MD5具有128位(16字节)输出,并且始终具有。以十六进制打印时,它是32个字符,但这是因为每个两个十六进制数字代表一个字节。