. */ namespace SP\Core\Crypt; use Defuse\Crypto\Key; use Defuse\Crypto\KeyProtectedByPassword; /** * Class Crypt * * @package SP\Core\Crypt */ interface CryptInterface { /** * Securiza una clave de seguridad * * @param string $password * @param bool $useAscii * * @return string|KeyProtectedByPassword * @throws \SP\Core\Exceptions\CryptException */ public function makeSecuredKey(string $password, bool $useAscii = true): KeyProtectedByPassword|string; /** * Encriptar datos con una clave segura * * @param string $data * @param string|Key $securedKey * @param string|null $password * * @return string * @throws \SP\Core\Exceptions\CryptException */ public function encrypt(string $data, Key|string $securedKey, ?string $password = null): string; /** * Desencriptar datos con una clave segura * * @param string $data * @param string|Key|KeyProtectedByPassword $securedKey * @param string|null $password * * @return string * @throws \SP\Core\Exceptions\CryptException */ public function decrypt( string $data, Key|KeyProtectedByPassword|string $securedKey, ?string $password = null ): string; }