CodeIgniter4/system/Encryption/EncrypterInterface.php

47 lines
1.1 KiB
PHP
Raw Normal View History

2019-05-05 01:32:02 -07:00
<?php
/**
2020-10-24 16:38:41 +08:00
* This file is part of the 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
*
2020-10-24 16:38:41 +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
*
* @throws EncryptionException
*
* @return string
*/
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
*
* @throws EncryptionException
*
* @return string
*/
public function decrypt($data, $params = null);
2019-05-05 01:32:02 -07:00
}