JCryptCipherSimple

Implements \JCryptCipher

JCrypt 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

integerThe 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

stringThe hex string to convert.

$i

integerThe offset?

Response

integer

_hexToIntArray

Convert hex to an array of integers

_hexToIntArray(string $hex) : array
since

11.1

Arguments

$hex

stringThe hex string to convert to an integer array.

Response

arrayAn array of integers.

_intToHex

Convert an integer to a hexadecimal string.

_intToHex(integer $i) : string
since

11.1

Arguments

$i

integerAn 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

\InvalidArgumentException

Arguments

$data

stringThe encrypted string to decrypt.

$key

\JCryptKeyThe key[/pair] object to use for decryption.

Response

stringThe decrypted data string.

encrypt

Method to encrypt a data string.

encrypt(string $data, \JCryptKey $key) : string
since

12.1

throws

\InvalidArgumentException

Arguments

$data

stringThe data string to encrypt.

$key

\JCryptKeyThe key[/pair] object to use for encryption.

Response

stringThe encrypted data string.

generateKey

Method to generate a new encryption key[/pair] object.

generateKey(array $options = array()) : \JCryptKey
since

12.1

Arguments

$options

arrayKey generation options.

Response

\JCryptKey