{
  "classes": [
    {
      "constants": [],
      "types": [],
      "name": "@eryx/crypto/des",
      "tags": [],
      "functions": [
        {
          "source": {
            "path": "",
            "line": 43
          },
          "is_method": false,
          "signature": "des.encryptCBC(\n    key: buffer,  -- Triple-DES key - exactly 24 bytes.\n    iv: buffer,  -- Initialisation vector - 8 bytes.\n    data: buffer  -- Plaintext to encrypt.\n) → (\n    buffer  -- Ciphertext. \n)",
          "owner": "des",
          "desc": "Encrypts `data` with 3DES-CBC (PKCS#7 padding).\n\nThe block size is 8 bytes, so the IV must also be 8 bytes. PKCS#7\npadding is applied automatically, rounding the output up to the\nnext 8-byte boundary.\n",
          "tags": [],
          "name": "encryptCBC",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Ciphertext. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Triple-DES key - exactly 24 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "iv",
              "desc": "Initialisation vector - 8 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Plaintext to encrypt."
            }
          ]
        },
        {
          "source": {
            "path": "",
            "line": 55
          },
          "is_method": false,
          "signature": "des.decryptCBC(\n    key: buffer,  -- Triple-DES key - exactly 24 bytes.\n    iv: buffer,  -- Initialisation vector - 8 bytes.\n    data: buffer  -- Ciphertext to decrypt.\n) → (\n    buffer  -- Plaintext. \n)",
          "owner": "des",
          "desc": "Decrypts 3DES-CBC ciphertext (strips PKCS#7 padding).\n",
          "tags": [],
          "name": "decryptCBC",
          "return_str": "buffer",
          "function_type": "Function",
          "returns": [
            {
              "lua_type": "buffer",
              "desc": "Plaintext. "
            }
          ],
          "params": [
            {
              "lua_type": "buffer",
              "name": "key",
              "desc": "Triple-DES key - exactly 24 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "iv",
              "desc": "Initialisation vector - 8 bytes."
            },
            {
              "lua_type": "buffer",
              "name": "data",
              "desc": "Ciphertext to decrypt."
            }
          ]
        }
      ],
      "properties": [],
      "source": {
        "path": "",
        "line": 0
      },
      "desc": "Triple-DES (3DES / TDEA) symmetric encryption.\n\nOnly **Triple-DES** is provided; single DES is cryptographically\nbroken and omitted intentionally. Keys must be exactly **24 bytes**\n(three independent 8-byte DES keys = 192-bit key material, ~112-bit\neffective security).\n\n:::warning\n3DES is a legacy cipher. Its 64-bit block size makes it vulnerable to\nbirthday attacks (Sweet32) in long sessions. Prefer AES for new designs.\n:::\n\nOnly CBC mode is defined for DES in PSA Crypto.\n\n```luau\nlocal des = require(\"@eryx/crypto/des\")\n\n-- Key MUST be exactly 24 bytes.\nlocal key = buffer.fromstring(\"123456789012345678901234\")\nlocal iv  = buffer.fromstring(\"12345678\")  -- 8 bytes\nlocal ct  = des.cbc_encrypt(key, iv, buffer.fromstring(\"Hello!!\"))\nlocal pt  = des.cbc_decrypt(key, iv, ct)\n```\n"
    }
  ]
}