CodeIgniter4/system/Encryption/EncrypterInterface.php

49 lines
1.1 KiB
PHP
Raw Normal View History

2019-05-05 01:32:02 -07:00
<?php
declare(strict_types=1);
2019-05-05 01:32:02 -07:00
/**
2021-07-19 21:32:33 +08:00
* This file is part of CodeIgniter 4 framework.
2019-05-05 01:32:02 -07:00
*
2020-10-24 16:38:41 +08:00
* (c) CodeIgniter Foundation <admin@codeigniter.com>
2019-05-05 01:32:02 -07:00
*
2021-07-19 21:32:33 +08:00
* For the full copyright and license information, please view
* the LICENSE file that was distributed with this source code.
2019-05-05 01:32:02 -07:00
*/
namespace CodeIgniter\Encryption;
2020-10-04 00:27:56 +07:00
use CodeIgniter\Encryption\Exceptions\EncryptionException;
2019-05-05 01:32:02 -07:00
/**
* CodeIgniter Encryption Handler
*
* Provides two-way keyed encryption
*/
interface EncrypterInterface
{
2021-06-04 22:51:52 +08:00
/**
* Encrypt - convert plaintext into ciphertext
*
* @param string $data Input data
* @param array|string|null $params Overridden parameters, specifically the key
*
* @return string
2022-09-08 14:40:53 +08:00
*
* @throws EncryptionException
2021-06-04 22:51:52 +08:00
*/
public function encrypt($data, $params = null);
2019-05-05 01:32:02 -07:00
2021-06-04 22:51:52 +08:00
/**
* Decrypt - convert ciphertext into plaintext
*
* @param string $data Encrypted data
* @param array|string|null $params Overridden parameters, specifically the key
*
* @return string
2022-09-08 14:40:53 +08:00
*
* @throws EncryptionException
2021-06-04 22:51:52 +08:00
*/
public function decrypt($data, $params = null);
2019-05-05 01:32:02 -07:00
}