1 | <?php |
||
20 | class HashService implements SingletonInterface |
||
21 | { |
||
22 | use SelfInstantiateTrait; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $sslCipher = 'AES-256-CBC'; //@todo |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $sslPassword = 'password!'; //@todo |
||
33 | |||
34 | /** |
||
35 | * @param string $value |
||
36 | * @return string |
||
37 | */ |
||
38 | public function getHash($value) |
||
42 | |||
43 | /** |
||
44 | * Encrypts data using OpenSSL library. |
||
45 | * |
||
46 | * @param mixed $data |
||
47 | * @return string |
||
48 | */ |
||
49 | public function encrypt($data) |
||
55 | |||
56 | /** |
||
57 | * Decrypts a hashed string using OpenSSL library. |
||
58 | * |
||
59 | * @param string $string |
||
60 | * @return mixed |
||
61 | */ |
||
62 | public function decrypt($string) |
||
72 | |||
73 | /** |
||
74 | * Checks that the `openssl` PHP extension is loaded. |
||
75 | * |
||
76 | * @throws ExtensionNotLoadedException |
||
77 | */ |
||
78 | protected function checkOpenSslAvailability() |
||
84 | } |
||
85 |