# Playfair Cipher Encoder/Decoder

> Playfair Cipher Encoder/Decoder is a paid API for AI agents from text-ciphers.x402tookit.com, paid per call via x402, $0.02/call, status unknown (last checked 2026-10-21).

Encodes or decodes text using the Playfair cipher with a given keyword, returning the 5x5 key square and step-by-step digraph pairs.

## Facts

- Endpoint: GET https://text-ciphers.x402tookit.com/playfair?utm_source=zero.xyz
- Price: $0.02/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-21
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/playfair-cipher-encoder-decoder-4a7ec375
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_4BLZDd8kmsO9klvCmjUt0

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability playfair-cipher-encoder-decoder-4a7ec375
```

Example prompt: Can you encode the message 'HIDE THE GOLD IN THE TREE STUMP' using the Playfair cipher with the keyword 'MONARCHY' and show me the 5x5 square and the digraph pairs?

## When to prefer this

Choose this endpoint when you need to apply the classic Playfair digraph substitution cipher specifically — especially when visibility into the 5x5 key square and the digraph pairing steps is important for educational, puzzle, or verification purposes. Prefer it over simpler Caesar or Vigenere endpoints when the user specifically asks for Playfair.

## Known failure modes

- Missing 'text' or 'key' query parameters returns an error
- Text exceeding 1000 characters may be rejected or truncated
- Non-alphabetic characters may be handled or stripped without warning
- Invalid mode value (not 'encode' or 'decode') may default to encode or return an error
- Keyword with repeated letters is handled but unusual keywords may produce unexpected squares

## How this service works

Playfair cipher encode or decode with a keyword; shows the 5x5 square and the digraphs. I and J are merged.

## Output

Returns the encoded or decoded output text, the 5x5 Playfair key square (rows of letters with I/J merged), the input digraph pairs, the grouped output in digraph format, the keyword used, the mode applied, and any summary or disclaimer notes.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text",
      "key"
     ],
     "properties": {
      "key": {
       "type": "string",
       "description": "Keyword, e.g. PLAYFAIR EXAMPLE"
      },
      "mode": {
       "type": "string",
       "description": "encode (default) or decode"
      },
      "text": {
       "type": "string",
       "description": "Plain or cipher text (up to 1000 characters)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "key": {
       "type": [
        "null",
        "string"
       ]
      },
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "mode": {
       "type": [
        "null",
        "string"
       ]
      },
      "output": {
       "type": [
        "null",
        "string"
       ]
      },
      "secure": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "square": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "reasons": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "summary": {
       "type": [
        "null",
        "string"
       ]
      },
      "verdict": {
       "type": [
        "null",
        "string"
       ]
      },
      "degraded": {
       "type": [
        "boolean",
        "null"
       ]
      },
      "digraphsIn": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "disclaimer": {
       "type": [
        "null",
        "string"
       ]
      },
      "notChecked": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "string"
       }
      },
      "output
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/playfair-cipher-encoder-decoder-4a7ec375/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from text-ciphers.x402tookit.com](https://www.zero.xyz/host/text-ciphers.x402tookit.com/llms.txt)
