New password algorithm: Argon2i

This commit is contained in:
Pig Fang 2019-12-25 16:28:24 +08:00
parent cf8358fdcd
commit c868b05232
4 changed files with 19 additions and 1 deletions

View File

@ -15,7 +15,7 @@ DB_PREFIX=
# Hash Algorithm for Passwords
#
# Available values:
# - BCRYPT, PHP_PASSWORD_HASH
# - BCRYPT, ARGON2I, PHP_PASSWORD_HASH
# - MD5, SALTED2MD5
# - SHA256, SALTED2SHA256
# - SHA512, SALTED2SHA512

View File

@ -0,0 +1,16 @@
<?php
namespace App\Services\Cipher;
class ARGON2I extends BaseCipher
{
public function hash($value, $salt = '')
{
return password_hash($value, PASSWORD_ARGON2I);
}
public function verify($password, $hash, $salt = '')
{
return password_verify($password, $hash);
}
}

View File

@ -17,6 +17,7 @@
- Added FAQ link at error page.
- Added login with 3rd-party services. (GitHub and Microsoft Live are supported currently.)
- Added support of character "§" for player name. (Under CJK mode.)
- New password hash algorithm: Argon2i.
## Tweaked

View File

@ -17,6 +17,7 @@
- 在错误页面增加指向 FAQ 页面的链接
- 第三方登录(目前仅支持 GitHub 和 Microsoft Live
- 角色名支持字符「§」需开启「CJK」模式
- 新的密码哈希算法Argon2i
## 调整