1 <?php
2 /**
3 * @package Joomla.Platform
4 * @subpackage Crypt
5 *
6 * @copyright Copyright (C) 2005 - 2017 Open Source Matters, Inc. All rights reserved.
7 * @license GNU General Public License version 2 or later; see LICENSE
8 */
9
10 defined('JPATH_PLATFORM') or die;
11
12 /**
13 * JCrypt cipher interface.
14 *
15 * @since 12.1
16 */
17 interface JCryptCipher
18 {
19 /**
20 * Method to decrypt a data string.
21 *
22 * @param string $data The encrypted string to decrypt.
23 * @param JCryptKey $key The key[/pair] object to use for decryption.
24 *
25 * @return string The decrypted data string.
26 *
27 * @since 12.1
28 */
29 public function decrypt($data, JCryptKey $key);
30
31 /**
32 * Method to encrypt a data string.
33 *
34 * @param string $data The data string to encrypt.
35 * @param JCryptKey $key The key[/pair] object to use for encryption.
36 *
37 * @return string The encrypted data string.
38 *
39 * @since 12.1
40 */
41 public function encrypt($data, JCryptKey $key);
42
43 /**
44 * Method to generate a new encryption key[/pair] object.
45 *
46 * @param array $options Key generation options.
47 *
48 * @return JCryptKey
49 *
50 * @since 12.1
51 */
52 public function generateKey(array $options = array());
53 }
54