Four-Square Cipher Tool
Explicit four-square diagonal rectangle digraph substitution. Classical educational encoding only; not secure encryption, no hidden normalization or inferred key.
Description
Four-square substitution combines standard and keyed letter squares for digraphs.
Four-square substitution combines standard and keyed letter squares for digraphs.1
Square order and the omitted-letter convention determine the reversible transformation. Use Four-Square Cipher Tool to evaluate the supplied inputs under the specific model below.
When to use Four-Square Cipher Tool
Use Four-Square Cipher Tool to evaluate the supplied inputs under the specific model below. Choose the intended encoding, alphabet or check and keep the exact character, key and measurement conventions described below.
How to use Four-Square Cipher Tool and understand its results
- Choose the intended encoding, alphabet or check and keep the exact character, key and measurement conventions described below.
- Enter Text, Caller square a, Caller square b, Decode using the field table and validation rules below, then run the tool.
- Read Transformed and interpret units, signs, ordering and placeholders as explained below.
- If the tool reports an input error, correct that field and rerun. A successful false result, empty match list or unknown-evidence placeholder has the specific meaning described here; check the limitations before applying the result.
| Input field | Meaning | Value type | Requirement |
|---|---|---|---|
| text | Text | string | Required; constraints below |
| callerSquareA | Caller square a | string | Required; constraints below |
| callerSquareB | Caller square b | string | Required; constraints below |
| decode | Decode | boolean | Required; constraints below |
Enter even-length text from ABCDEFGHIKLMNOPQRSTUVWXYZ, two keyed permutations of that exact 25-letter alphabet and a decode flag. Encoding finds pair coordinates in the ordinary square and selects opposite corners in the two keyed squares; decoding finds keyed coordinates and returns ordinary-square corners. No J substitution or filler insertion is performed.
encode = keyedA[row1,col2]+keyedB[row2,col1]; decode returns ordinary-square opposite corners Field order, units and branch conditions follow the implementation explanation above.
| Output field | Meaning | Value type |
|---|---|---|
| transformed | Transformed | string |
{
"input": {
"text": "AB",
"callerSquareA": "ABCDEFGHIKLMNOPQRSTUVWXYZ",
"callerSquareB": "ABCDEFGHIKLMNOPQRSTUVWXYZ",
"decode": false
},
"output": {
"transformed": "BA"
}
} Limitations and assumptions
Square order and the omitted-letter convention determine the reversible transformation. Apply the exact scope and assumptions described above.
All listed fields require explicit values. Unexpected fields, incorrect types, nonfinite numbers and sparse arrays fail validation. Domain-specific bounds, alignments and supported tokens are stated above; extremely large inputs or outputs can also be rejected. These errors differ from successful results such as false, no matches or unknown evidence.
This educational transformation or format check does not establish modern cryptographic confidentiality, authentication or key security.
Alternative or Complementary methods
Use AD FGX Cipher Tool for a related task: ADFGX combines five-by-five coordinate substitution with keyed column transposition.
Use Two-Square Cipher Tool for a related task: A two-square transformation uses two independently supplied letter grids.
References
-
Four-Square Cipher Tool — tool.io
Similar or alternative tools
- AD FGX Cipher Tool
ADFGX combines five-by-five coordinate substitution with keyed column transposition.
- Two-Square Cipher Tool
A two-square transformation uses two independently supplied letter grids.