JCryptCipherSimple
Implements \JCryptCipherJCrypt cipher for Simple encryption, decryption and key generation.
package |
Joomla.Platform |
---|---|
subpackage |
Crypt |
since |
12.1 |
Methods
_getRandomKey
Method to generate a random key of a given length.
_getRandomKey(integer $length = 256) : string
since |
12.1 |
---|
Arguments
- $length
integer
The length of the key to generate.
Response
string
_hexToInt
Convert hex to an integer
_hexToInt(string $s, integer $i) : integer
since |
11.1 |
---|
Arguments
- $s
string
The hex string to convert.- $i
integer
The offset?
Response
integer
_hexToIntArray
Convert hex to an array of integers
_hexToIntArray(string $hex) : array
since |
11.1 |
---|
Arguments
- $hex
string
The hex string to convert to an integer array.
Response
array
An array of integers.
_intToHex
Convert an integer to a hexadecimal string.
_intToHex(integer $i) : string
since |
11.1 |
---|
Arguments
- $i
integer
An integer value to convert to a hex string.
Response
string
decrypt
Method to decrypt a data string.
decrypt(string $data, \JCryptKey $key) : string
since |
12.1 |
---|---|
throws |
|
Arguments
- $data
string
The encrypted string to decrypt.- $key
\JCryptKey
The key[/pair] object to use for decryption.
Response
string
The decrypted data string.
encrypt
Method to encrypt a data string.
encrypt(string $data, \JCryptKey $key) : string
since |
12.1 |
---|---|
throws |
|
Arguments
- $data
string
The data string to encrypt.- $key
\JCryptKey
The key[/pair] object to use for encryption.
Response
string
The encrypted data string.
generateKey
Method to generate a new encryption key[/pair] object.
generateKey(array $options = array()) : \JCryptKey