update ciphers
This commit is contained in:
parent
6aaec6f658
commit
f71190e286
@ -29,7 +29,7 @@ DB_PREFIX = null
|
||||
|
||||
# Encrypt Method for Passwords.
|
||||
#
|
||||
# Available values: MD5, SALTED2MD5, SHA256
|
||||
# Available values: MD5, SALTED2MD5, (SALTED2)SHA256, (SALTED2)SHA512
|
||||
PWD_METHOD = SALTED2MD5
|
||||
|
||||
# Salt
|
||||
|
21
app/Events/PlayerWillBeAdded.php
Normal file
21
app/Events/PlayerWillBeAdded.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use App\Models\Player;
|
||||
|
||||
class PlayerWillBeAdded extends Event
|
||||
{
|
||||
public $playerName;
|
||||
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($player_name)
|
||||
{
|
||||
$this->playerName = $player_name;
|
||||
}
|
||||
|
||||
}
|
@ -13,6 +13,7 @@ use Illuminate\Http\Request;
|
||||
use App\Events\PlayerWasAdded;
|
||||
use App\Events\PlayerWasDeleted;
|
||||
use App\Events\CheckPlayerExists;
|
||||
use App\Events\PlayerWillBeAdded;
|
||||
use App\Exceptions\PrettyPageException;
|
||||
use App\Services\Repositories\UserRepository;
|
||||
|
||||
@ -61,6 +62,8 @@ class PlayerController extends Controller
|
||||
return json(trans('user.player.add.lack-score'), 7);
|
||||
}
|
||||
|
||||
Event::fire(new PlayerWillBeAdded($request->input('player_name')));
|
||||
|
||||
$player = new Player;
|
||||
|
||||
$player->uid = $this->user->uid;
|
||||
|
@ -1,22 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cipher;
|
||||
|
||||
class CrazyCrypt1 implements EncryptInterface
|
||||
{
|
||||
/**
|
||||
* Fucking CrazyCrypt1
|
||||
*
|
||||
* https://github.com/ST-DDT/CrazyLogin/blob/master/php/Encryptors/CrazyCrypt1.php
|
||||
*/
|
||||
public function encrypt($raw_passwd, $salt = "") {
|
||||
// salt is username
|
||||
$text = "ÜÄaeut//&/=I " . $raw_passwd . "7421€547" . $salt . "__+IÄIH§%NK " . $raw_passwd;
|
||||
$t1 = unpack("H*", $text);
|
||||
$t2 = substr($t1[1], 0, mb_strlen($text, 'UTF-8')*2);
|
||||
$t3 = pack("H*", $t2);
|
||||
$encrypt = hash("sha512", $t3);
|
||||
return $encrypt;
|
||||
}
|
||||
|
||||
}
|
17
app/Services/Cipher/SALTED2SHA256.php
Normal file
17
app/Services/Cipher/SALTED2SHA256.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cipher;
|
||||
|
||||
class SHA256 implements EncryptInterface
|
||||
{
|
||||
/**
|
||||
* Default SHA256 encryption method for Authme
|
||||
*
|
||||
* @see http://pastebin.com/1wy9g2HT
|
||||
*/
|
||||
public function encrypt($raw_passwd, $salt = "") {
|
||||
$encrypt = hash('sha256', hash('sha256', $raw_passwd).$salt);
|
||||
return $encrypt;
|
||||
}
|
||||
|
||||
}
|
17
app/Services/Cipher/SALTED2SHA512.php
Normal file
17
app/Services/Cipher/SALTED2SHA512.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cipher;
|
||||
|
||||
class SHA256 implements EncryptInterface
|
||||
{
|
||||
/**
|
||||
* Default SHA256 encryption method for Authme
|
||||
*
|
||||
* @see http://pastebin.com/1wy9g2HT
|
||||
*/
|
||||
public function encrypt($raw_passwd, $salt = "") {
|
||||
$encrypt = hash('sha512', hash('sha256', $raw_passwd).$salt);
|
||||
return $encrypt;
|
||||
}
|
||||
|
||||
}
|
@ -10,7 +10,7 @@ class SHA256 implements EncryptInterface
|
||||
* @see http://pastebin.com/1wy9g2HT
|
||||
*/
|
||||
public function encrypt($raw_passwd, $salt = "") {
|
||||
$encrypt = hash('sha256', hash('sha256', $raw_passwd).$salt);
|
||||
$encrypt = hash('sha256', $raw_passwd);
|
||||
return $encrypt;
|
||||
}
|
||||
|
||||
|
17
app/Services/Cipher/SHA512.php
Normal file
17
app/Services/Cipher/SHA512.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services\Cipher;
|
||||
|
||||
class SHA256 implements EncryptInterface
|
||||
{
|
||||
/**
|
||||
* Default SHA256 encryption method for Authme
|
||||
*
|
||||
* @see http://pastebin.com/1wy9g2HT
|
||||
*/
|
||||
public function encrypt($raw_passwd, $salt = "") {
|
||||
$encrypt = hash('sha512', $raw_passwd);
|
||||
return $encrypt;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user