Symmetrically encrypt data with crypt.encrypt
crypt-encryptEncrypt a plaintext string in Roblox using a Base64 key, optional IV, and cipher mode; returns ciphertext and IV used.
Instructions
Encrypt a string with the executor's crypt.encrypt(data, key, iv?, mode?). The key is a Base64 string (see crypt-generate-key). An optional Base64 initialization vector (iv) and an optional cipher mode (e.g. 'CBC', 'CTR') may be supplied; when omitted the executor picks/derives them. The function returns the ciphertext plus the iv actually used, both of which are reported. This is a pure, side-effect-free compute that runs entirely in-game. Requires crypt.encrypt; on an executor without it, it returns { error } instead of throwing. The call is pcall-guarded so a bad key/iv degrades to a clean error. Returns { ciphertext, iv } or { error }. Signature: { data: string, key: string, iv: string?, mode: string?, threadContext: number?, timeoutMs: number? }. Phase: observe; cost=medium; idempotency=read-only. Requires: active-client. Produces: structured-result. Safety: read-only. On failure: inspect tool-schema for exact fields, defaults, constraints, and an invocation example.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| iv | No | Optional Base64-encoded initialization vector; omit to let the executor derive one. | |
| key | Yes | The Base64-encoded symmetric key (see crypt-generate-key). | |
| data | Yes | The plaintext string to encrypt. | |
| mode | No | Optional cipher mode (e.g. 'CBC', 'CTR', 'CFB', 'OFB', 'ECB'); omit for the executor default. | |
| timeoutMs | No | Optional per-call deadline in milliseconds; omit it to use the tool or server default. | |
| threadContext | No | Optional Roblox thread identity for this call; omit it to use the server default. |