Crypt

Extends \Joomla\Crypt\Crypt

Crypt is a Joomla Platform class for handling basic encryption/decryption of data.

since

3.0.0

Methods

safeStrlen

Safely detect a string's length

safeStrlen(string $str) : integer
static

This method is derived from \ParagonIE\Halite\Util::safeStrlen()

since

3.5

ref

mbstring.func_overload

throws

\RuntimeException

Arguments

$str

stringString to check the length of

Response

integer

safeSubstr

Safely extract a substring

safeSubstr(string $str, integer $start, integer $length = null) : string
static

This method is derived from \ParagonIE\Halite\Util::safeSubstr()

since

3.5

Arguments

$str

stringThe string to extract the substring from

$start

integerThe starting position to extract from

$length

integerThe length of the string to return

Response

string

timingSafeCompare

A timing safe comparison method.

timingSafeCompare(string $known, string $unknown) : boolean
static

This defeats hacking attempts that use timing based attack vectors.

NOTE: Length will leak.

since

3.2

Arguments

$known

stringA known string to check against.

$unknown

stringAn unknown string to check.

Response

booleanTrue if the two strings are exactly the same.