Skip to main content

Generate UUID

ParameterPurposeExample
$myVariableThis is the variable you want to store the generated value in.$myVariable

Create Authentication Token

ParameterPurposeExample
dbtableThe ID of the database table that has authentication enabled”97”
extrasA JSON object that contains any extra information you want to include in the token
    ’{“role”:“admin”}‘|json_decode
expirationThe time in seconds that the token should remain valid86400
idThe ID of the record to use to generate the authentication token1
asThe variable to store the generated token in$authToken

Validate Password

ParameterPurposeExample
text_passwordThe text version of the password to check”textPassword”
$textPassword
hash_passwordThe hashed version of the password to check, usually coming from a database table”hashedPassword”
$user1.password

Generate Password

ParameterPurposeExample
character_countThe length of the generated password12
require_lowercase
require_uppercase
require_digit
require_symbol
Various specifications for the generated password
require_lowercase = true
require_uppercase = true
require_digit = true
require_symbol = true
symbol_whitelistIf you require symbols in your generated password, whitelist the allowed symbols here.
symbol_whitelist = ”$#%&“
asThe variable that you want to store the generated password.generatedPassword

Generate Random Number

ParameterPurposeExample
minThe beginning of the range for the randomly generated number0
maxThe end of the range for the randomly generated number10000
asThe variable that you want to store the generated numberrandomNumber

Generate Random Bytes

ParameterPurposeExample
lengthThe length of the string you’d like to generate16
asThe variable that you want to store the random bytes generatedrandomBytes

Create Secret Key

ParameterPurposeExample
bitsThe length of the key generated. Common values are 1024, 2048, 4096, etc…1024
formatThe format of the key generated. This can be either object or base64”object”
asThe variable that you want to store the keycrypto1

Create RSA Key

ParameterPurposeExample
bitsThe length of the key generated. Common values are 1024, 2048, 4096, etc…1024
formatThe format of the key generated. This can be either object or base64”object”
asThe variable that you want to store the keycrypto1

Create Elliptic Curve Key

Encrypt Data

Encrypts a payload into binary data using the specified algorithm, key, and initialization vector. The result is stored in $encrypted_data.

Decrypt Data

Decrypts a payload back to its original form using the specified algorithm, key, and initialization vector. The result is stored in $decrypted_data.

JWS Encode

Encodes a payload as a JSON Web Signature (JWS) token with headers, claims, and a key. The result is stored in $signed_token.

JWS Decode

Decodes a JWS token using the key and signature algorithm. The result is stored in $verified_payload.

JWE Encode

Encodes a payload as a JSON Web Encryption (JWE) token with headers, claims, and a key. The result is stored in $encrypted_token.

JWE Decode

Decodes a JWE token using the key, key algorithm, and content algorithm. The result is stored in $decoded_payload.
ParameterPurposeExample
curveThe curve applied to the generated key. Can be P-256, P-384, or P-521P-256
formatThe format of the key generated. This can be either object or base64”object”
asThe variable that you want to store the keycrypto3