---
title: "Cryptography"
description: "Encoding, hashing, encryption, and compression."
icon: "key-round"
---

## Available functions

<div className="byte-function-directory">
<CardGroup cols={2}>
  <Card title="base64_decode" href="/reference/crypt/base64_decode">
    Decodes Base64 into bytes.
  </Card>
  <Card title="base64_encode" href="/reference/crypt/base64_encode">
    Encodes arbitrary bytes as Base64.
  </Card>
  <Card title="crypt.decrypt" href="/reference/crypt/crypt-decrypt">
    Decrypts Base64 AES-256-CBC ciphertext into raw plaintext.
  </Card>
  <Card title="crypt.encrypt" href="/reference/crypt/crypt-encrypt">
    Encrypts raw plaintext using AES-256-CBC and returns Base64 ciphertext plus Base64 IV.
  </Card>
  <Card title="crypt.generatebytes" href="/reference/crypt/crypt-generatebytes">
    Generates secure random bytes and returns them Base64-encoded.
  </Card>
  <Card title="crypt.generatekey" href="/reference/crypt/crypt-generatekey">
    Generates a Base64-encoded 32-byte key.
  </Card>
  <Card title="crypt.hash" href="/reference/crypt/crypt-hash">
    Returns a hexadecimal digest.
  </Card>
  <Card title="crypt.hmac" href="/reference/crypt/crypt-hmac">
    Computes HMAC-SHA256 and returns a Base64 digest.
  </Card>
  <Card title="crypt.random" href="/reference/crypt/crypt-random">
    Returns raw secure random bytes.
  </Card>
  <Card title="getfunctionhash" href="/reference/crypt/getfunctionhash">
    Hashes a Luau function's prototype-derived representation using SHA384.
  </Card>
  <Card title="lz4compress" href="/reference/crypt/lz4compress">
    Compresses bytes into a raw LZ4 block.
  </Card>
  <Card title="lz4decompress" href="/reference/crypt/lz4decompress">
    Decompresses bytes produced by Byte's LZ4 compressor.
  </Card>
</CardGroup>
</div>
