Cryptography

crypt.generatekey

Generates a random key suitable for supported cryptographic helpers.

Syntax

crypt.generatekey(): string

Returns

NameTypeDescription
keystringGenerated cryptographic key.

Description

Generates a random key suitable for supported cryptographic helpers.

Call it without parameters. The function reads the needed context from the current runtime state.

It returns key (string). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = crypt.generatekey()
print(result)