Crypto

Implements CipherInterface

Joomla cipher for encryption, decryption and key generation via the php-encryption library.

since

2.0.0

package

Joomla Framework

Methods

decrypt

Method to decrypt a data string.

decrypt( data, \Joomla\Crypt\Key key) : 
since

2.0.0

throws

DecryptionExceptionif the data cannot be decrypted

InvalidKeyTypeExceptionif the key is not valid for the cipher

Arguments

data

stringThe encrypted string to decrypt.

key

KeyThe key object to use for decryption.

Response

stringThe decrypted data string.

encrypt

Method to encrypt a data string.

encrypt( data, \Joomla\Crypt\Key key) : 
since

2.0.0

throws

EncryptionExceptionif the data cannot be encrypted

InvalidKeyTypeExceptionif the key is not valid for the cipher

Arguments

data

stringThe data string to encrypt.

key

KeyThe key object to use for encryption.

Response

stringThe encrypted data string.

generateKey

Method to generate a new encryption key object.

generateKey(mixed||string|int options = []) : \Joomla\Crypt\Key
since

2.0.0

throws

InvalidKeyExceptionif the key cannot be generated

Arguments

options

array<string|int, mixed>Key generation options.

Response

Key

isSupported

Check if the cipher is supported in this environment.

isSupported() : 
static
since

2.0.0

Response

bool