inc\classes\security.php
Security tools
Used to implement escaping functions, etc
- Author
- Sergey Dilong
- License
- GPL-2.0
- Package
- Temply-Account\Core
\security
Package: Temply-Account\Core
Parameters
Returns
Parameters
Returns
Parameters
Returns
Parameters
Returns
Throws
Details
Security class
Vars checking, token generating, encrypting
- Author
- Sergey Dilong
- License
- GPL-2.0
Methods

clean(mixed $a, boolean $n = false) : mixedstatic
Var clean
Make variables clear and correct
| Name | Type | Description |
|---|---|---|
| $a | mixed | Var to check |
| $n | boolean | Output check. If |
| Type | Description |
|---|---|
| mixed | Result |

decrypt(string $ciphertext, string $key, string $iv, string $tag, array $o = array()) : string | booleanstatic
Decrypt
Decrypts string
| Name | Type | Description |
|---|---|---|
| $ciphertext | string | Encodedtext |
| $key | string | Key |
| $iv | string | IV |
| $tag | string | Tag |
| $o | array | Options
|
| Type | Description |
|---|---|
| string | boolean | Result. If `false` - failed. |

encrypt(string $plaintext, array $o = array()) : array<mixed,string> | booleanstatic
Encrypt
Encrypts text
| Name | Type | Description |
|---|---|---|
| $plaintext | string | Text to encrypt |
| $o | array | Options
|
| Type | Description |
|---|---|
| array<mixed,string> | boolean | Returns `[$encrypted, $iv, $tag, $key ]` or `false` if failed |

filter(mixed $a, boolean $n = false) : mixedstatic
Var filter
Make variables and arrays secure and clear
| Name | Type | Description |
|---|---|---|
| $a | mixed | Var to check |
| $n | boolean | Output check. If |
| Type | Description |
|---|---|
| mixed | Checked var |
| Exception | Description |
|---|---|
| \apiException | * [103] Checking failed |