Crypt
Crypt is a Joomla Framework class for handling basic encryption/decryption of data.
since |
1.0 |
---|---|
package |
Joomla Framework |
Methods
__construct
Object Constructor takes an optional key to be used for encryption/decryption. If no key is given then the secret word from the configuration object is used.
__construct(\Joomla\Crypt\CipherInterface cipher = null, \Joomla\Crypt\Key key = null) : mixed
since |
1.0 |
---|
Arguments
- cipher
\Joomla\Crypt\CipherInterface
The encryption cipher object.- key
\Joomla\Crypt\Key
The encryption key[/pair)].
Response
mixed
decrypt
Method to decrypt a data string.
decrypt(string data) : string
since |
1.0 |
---|---|
throws |
|
Arguments
- data
string
The encrypted string to decrypt.
Response
string
The decrypted data string.
encrypt
Method to encrypt a data string.
encrypt(string data) : string
since |
1.0 |
---|---|
throws |
|
Arguments
- data
string
The data string to encrypt.
Response
string
The encrypted data string.
generateKey
Method to generate a new encryption key[/pair] object.
generateKey(array options = []) : \Joomla\Crypt\Key
since |
1.0 |
---|---|
throws |
|
Arguments
- options
array
Key generation options.
Response
\Joomla\Crypt\Key
genRandomBytes
Generate random bytes.
genRandomBytes(int length = 16) : string
since |
1.0 |
---|
Arguments
- length
int
Length of the random data to generate
Response
string
Random binary data
setKey
Method to set the encryption key[/pair] object.
setKey(\Joomla\Crypt\Key key) : \Joomla\Crypt\Crypt
since |
1.0 |
---|
Arguments
- key
\Joomla\Crypt\Key
The key object to set.
Response
\Joomla\Crypt\Crypt
Instance of $this to allow chaining.
Properties
cipher
The encryption cipher object.
since |
1.0 |
---|
Type(s)
\Joomla\Crypt\CipherInterface
key
The encryption key[/pair)].
since |
1.0 |
---|
Type(s)
\Joomla\Crypt\Key