Hill 2×2 Cipher Encoder

Explicit invertible2×2 Hill encoding of column digraph vectors mod 26. Classical educational encoding only; not secure encryption, no hidden normalization or inferred key.

Description

A two-by-two Hill cipher transforms letter pairs by matrix multiplication modulo twenty-six.

A two-by-two Hill cipher transforms letter pairs by matrix multiplication modulo twenty-six.1

An invertible key is required for the corresponding decoding operation. Use Hill 2×2 Cipher Encoder to evaluate the supplied inputs under the specific model below.

When to use Hill 2×2 Cipher Encoder

Use Hill 2×2 Cipher Encoder 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 Hill 2×2 Cipher Encoder and understand its results

  1. Choose the intended encoding, alphabet or check and keep the exact character, key and measurement conventions described below.
  2. Enter Text, Key matrix using the field table and validation rules below, then run the tool.
  3. Read Transformed and interpret units, signs, ordering and placeholders as explained below.
  4. 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 fieldMeaningValue typeRequirement
textTextstringRequired; constraints below
keyMatrixKey matrixarray of arrayRequired; constraints below

Enter even-length uppercase A–Z plaintext and a 2×2 integer key with entries from 0 to 25. The determinant must be invertible modulo 26; this is required for encoding as well as decoding. Multiply each two-letter column vector by the key modulo 26. Empty text is allowed; no filler or case normalization is performed.

cipherPairColumn = keyMatrix×plaintextPairColumn mod 26

Field order, units and branch conditions follow the implementation explanation above.

Output fieldMeaningValue type
transformedTransformedstring
json
{
  "input": {
    "text": "HELP",
    "keyMatrix": [
      [
        3,
        3
      ],
      [
        2,
        5
      ]
    ]
  },
  "output": {
    "transformed": "HIAT"
  }
}

Limitations and assumptions

An invertible key is required for the corresponding decoding operation. 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 Hill 2×2 Cipher Decoder for a related task: Hill decoding uses the key matrix's modular inverse.

Use Two-Square Cipher Tool for a related task: A two-square transformation uses two independently supplied letter grids.

References

  1. Hill 2×2 Cipher Encoder — tool.io

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies