crypt.generatekey
Generates a random AES key.
Syntax
Signature
crypt.generatekey() -> stringAliases
This function has no aliases.
Parameters
This function takes no parameters.
Returns
| Type | Description |
|---|---|
string | Base64-encoded 256-bit key. |
Notes
Generates a random 32-byte key and returns it as Base64. The result can be passed directly to crypt.encrypt or crypt.decrypt.
Example
Luau
local Result = crypt.generatekey()
print(Result)