PHP password_hash() password_verify() maximum password length?

后端 未结 4 1372
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 01:48

What is the maximum password length I can use with PHP 5.5 password_hash() and password_verify()?

4条回答
  •  一整个雨季
    2020-12-07 02:31

    The function doesn't have any limit, you just have to keep your memory_limit in mind, that should be all.

    Edit: You should limit the password length, otherwise it could slow down your server (depending on the algo)
    see django: https://www.djangoproject.com/weblog/2013/sep/15/security/

    Edit 2: to clarify: there shouldn't be a limit to 14-20 characters, it should be 4KB or more.

提交回复
热议问题