Crypt

Extends \Joomla\Crypt\Crypt

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

since

3.0.0

package

Application

Methods

safeStrlen

Safely detect a string's length

safeStrlen(string str) : int
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

int

safeSubstr

Safely extract a substring

safeSubstr(string str, int start, int 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

intThe starting position to extract from

length

intThe length of the string to return

Response

string

timingSafeCompare

A timing safe comparison method.

timingSafeCompare(string known, string unknown) : bool
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

boolTrue if the two strings are exactly the same.