> ## 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.decrypt

> يفك تشفير Base64 ciphertext باستخدام مفتاح مفكوك من Base64 و Base64 IV مطلوب عبر AES CBC او ECB.

<div className="real-function-page">
  ```lua theme={null}
  crypt.decrypt(data: string, key: string, iv: string, mode?: "CBC" | "ECB" | "AES-CBC" | "AES-ECB"): string
  ```

  ## الوسائط

  <ParamField path={"data"} type={"string"} required>
    Base64 ciphertext الذي يتم فكه قبل التشفير العكسي.
  </ParamField>

  <ParamField path={"key"} type={"string"} required>
    مفتاح Base64 يتم فكه قبل تمريره إلى AES.
  </ParamField>

  <ParamField path={"iv"} type={"string"} required>
    Base64 IV يتم فكه قبل معالجة mode. هذا الوسيط مطلوب، حتى مع ECB.
  </ParamField>

  <ParamField path={"mode"} type={"\"CBC\" | \"ECB\" | \"AES-CBC\" | \"AES-ECB\""}>
    AES mode. تتم إزالة بادئة AES- عند وجودها. القيمة الافتراضية هي AES-CBC.
  </ParamField>

  ## القيم الراجعة

  <ResponseField name={"plaintext"} type={"string"}>
    بايتات plaintext المعادة كسلسلة Lua.
  </ResponseField>

  ## مثال

  فك تشفير ciphertext المعاد من crypt.encrypt باستخدام IV المعاد.

  ```lua theme={null}
  local key = crypt.generatekey()
  local ciphertext, iv = crypt.encrypt("hello world", key)

  local plaintext = crypt.decrypt(ciphertext, key, iv)

  print(plaintext)
  ```
</div>
