> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# crypt.generatekey

> random byte generator ile 32 rastgele raw bytes uretir ve bunlari Base64-encoded Lua string olarak dondurur.

<div className="real-function-page">
  ```lua theme={null}
  crypt.generatekey(): string
  ```

  ## Dönüşler

  <ResponseField name={"key"} type={"string"}>
    Uretilen 32 raw bytes icin Base64 encoding. Dondurulen string 32 karakter uzunlugunda degildir.
  </ResponseField>

  ## Örnek

  Bir Base64 key uret ve raw bytes sayisini incelemek icin decode et.

  ```lua theme={null}
  local key = crypt.generatekey()
  local raw = base64_decode(key)

  local ciphertext, iv = crypt.encrypt("hello world", key)

  print(key)
  print(#raw)
  print(ciphertext, iv)
  ```
</div>
