Crypt

Extends Crypt

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

since

3.0.0

package

Joomla CMS

Methods

safeStrlen

Safely detect a string's length

safeStrlen( str) : 
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( str,  start,  length = null) : 
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( known,  unknown) : 
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.