This commit is contained in:
2024-09-17 14:02:17 +02:00
commit 111fac9a42
2886 changed files with 189561 additions and 0 deletions

View File

@ -0,0 +1,27 @@
<?php
namespace App\Service;
use Symfony\Component\Security\Core\Encoder\PasswordEncoderInterface;
class passwordEncoder implements PasswordEncoderInterface
{
public function encodePassword($raw, $salt)
{
$hash = "{SSHA}" . base64_encode(pack("H*", sha1($raw . $salt)) . $salt);
return $hash;
}
public function isPasswordValid($encoded, $raw, $salt)
{
return $encoded === $this->encodePassword($raw, $salt);
}
public function needsRehash(string $encoded): bool
{
// check whether the current password is hash using an outdated encoder
$hashIsOutdated = false;
return $hashIsOutdated;
}
}