代码之家  ›  专栏  ›  技术社区  ›  agiliq

WordPress密码哈希是如何工作的?

  •  4
  • agiliq  · 技术社区  · 16 年前

    我需要将django系统与wordpress站点集成在一起,就像wordpress一样,用户应该能够登录django部分,反之亦然。

    为此,我需要了解密码散列如何在WordPress中工作。我能看见 wp_users 存储用户名和密码哈希的表。

    通过查看wordpress代码,我可以看到密码是通过 wp_set_password ,它正在使用 hash_password 散列密码。

    现在我不知道足够的PHP来理解它是如何工作的。我需要在python中复制相同的内容,以便从django部分验证密码。

    2 回复  |  直到 16 年前
        1
  •  7
  •   Eli Bendersky    16 年前

    在实施过程中有一条评论说:

      28  /**
      29   * Portable PHP password hashing framework.
      30   *
      31   * @package phpass
      32   * @version 0.1 / genuine
      33   * @link http://www.openwall.com/phpass/
      34   * @since 2.5
      35   */
    

    使用的哈希框架是 phpass 和它的页面链接到一个Python实现。 Here's the link (.tar.gz) . 该页面还有一些其他有用的链接(例如Perl实现)。

        2
  •  2
  •   Wordpress Warrior    15 年前

    下面是WordPress3.1的“wp includes\pluggable.php”中的一段评论:

     /**
     * For integration with other applications, this function can be overwritten to
     * instead use the other package password checking algorithm.
     */