Encryption (and decryption) component.
More...
|
| str ($str, $key=null) |
| Encrypt a string. More...
|
|
| decrypt ($data, $key=null) |
| Decrypt an encrypted string. More...
|
|
| file ($source, $target, $key=null) |
| Encrypt a file. More...
|
|
| decryptFile ($source, $target, $key=null) |
| Decrypt an encrypted file. More...
|
|
| __construct ($fred, $config=null) |
|
| __destruct () |
|
| clientConfig () |
| Public configuration. More...
|
|
| config ($key, $default=null) |
| Retrieve a config value. More...
|
|
| ping () |
| Ping function. More...
|
|
| filemtime ($filename) |
| Filemtime with session cache. More...
|
|
| component ($name) |
| Get a component (local or default). More...
|
|
| components (... $names) |
| Get multiple components in an array. More...
|
|
| propertyExists ($property) |
| Check if a property exists (public or published). More...
|
|
| constants ($prefix=null) |
| Return all constants. More...
|
|
| get ($key) |
| Get one or more properties. More...
|
|
| set ($key, $value=null) |
| Set one or more properties. More...
|
|
| __get ($key) |
|
| __set ($key, $value) |
|
|
| key ($key) |
| Generate an encryption key. More...
|
|
| initVector (&$length=null) |
| Generate an initialization vector. More...
|
|
| getKey () |
|
| init () |
|
| done () |
|
| getSession () |
|
| publish ($property, $visibility=self::READABLE) |
| Publish a property (or hide it again). More...
|
|
| configure ($config) |
| Configure the object. More...
|
|
| _get ($key) |
| Default getter if no specific setter is defined, and the property is also not published (readable). More...
|
|
| _set ($key, $value) |
| Default setter if no specific setter is defined, and the property is also not published (writeable). More...
|
|
Encryption (and decryption) component.
Definition at line 8 of file Encrypt.php.
◆ decrypt()
decrypt |
( |
|
$data, |
|
|
|
$key = null |
|
) |
| |
Decrypt an encrypted string.
- Parameters
-
string | $data | String encrypted with str(). |
string | $key | Key for decryption (same one as used with encryption). |
- Returns
- string Decrypted string.
Definition at line 49 of file Encrypt.php.
◆ decryptFile()
decryptFile |
( |
|
$source, |
|
|
|
$target, |
|
|
|
$key = null |
|
) |
| |
Decrypt an encrypted file.
- Parameters
-
string | $source | File encrypted with file(). |
string | $target | File to write decrypted data to. |
string | $key | Key for decryption (same one as used with encryption). |
- Returns
- int Number of bytes written.
Definition at line 82 of file Encrypt.php.
◆ file()
file |
( |
|
$source, |
|
|
|
$target, |
|
|
|
$key = null |
|
) |
| |
Encrypt a file.
- Parameters
-
string | $source | Original file. |
string | $target | File to write encrypted data to. This includes the used method and block size, so these can be safely changed. |
string | $key | Key for encryption. |
- Returns
- int Number of bytes written.
Definition at line 61 of file Encrypt.php.
◆ getKey()
◆ initVector()
initVector |
( |
& |
$length = null | ) |
|
|
protected |
Generate an initialization vector.
- Parameters
-
int | $length | Length of the initialization vector. |
- Returns
- string Generated initialization vector (binary).
Definition at line 28 of file Encrypt.php.
◆ key()
Generate an encryption key.
- Parameters
-
string | $key | Custom/user key. |
- Returns
- string Generated key based on custom/user key and master key (binary).
Definition at line 20 of file Encrypt.php.
◆ str()
str |
( |
|
$str, |
|
|
|
$key = null |
|
) |
| |
Encrypt a string.
- Parameters
-
string | $str | Input string. |
string | $key | Key for encryption. |
- Returns
- string Encrypted data (binary). This includes the used method, so this can be safely changed.
Definition at line 39 of file Encrypt.php.
◆ $_blockSize
File encryption block size.
Definition at line 13 of file Encrypt.php.
◆ $_key
Master key (used for padding).
Definition at line 10 of file Encrypt.php.
◆ $_keyFile
File where master key is stored. If the file does not exist, a key is generated and saved.
Definition at line 11 of file Encrypt.php.
◆ $_method
Encryption method (see openssl_get_cipher_methods()).
Definition at line 12 of file Encrypt.php.
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/fred/src/Rsi/Fred/Encrypt.php