以 $1$... 开头的哈希是什么?

信息安全 哈希
2021-08-16 12:55:16

我找到了这个哈希,我想知道它是什么。

$1$h6k3X5db$pp8WQ5R5YYL5bNyQj2wP70

2个回答

如果它是由crypt(3)生成的,那么它是一个 MD5 哈希。

如果 salt 是一个以字符“$id$”开头的字符串,后跟一个以“$”结尾的字符串:

        $id$salt$encrypted

  then instead of using the DES machine, id identifies the
  encryption method used and this then determines how the rest
  of the password string is interpreted.  The following values
  of id are supported:

         ID  | Method
         ─────────────────────────────────────────────────────────
         1   | MD5
         2a  | Blowfish (not in mainline glibc; added in some
             | Linux distributions)
         5   | SHA-256 (since glibc 2.7)
         6   | SHA-512 (since glibc 2.7)

如果它是一个 UNIX crypt(),那么它就是一个 MD5 散列。

正如 PHP 的crypt page中所写,通常以 $1$ 开头的哈希是 MD5 哈希。$ 符号是分隔符,但开头的 $1$ 表示它是 MD5。如果您希望强制执行此操作,大多数工具会自动检测散列算法。