Text & Encoding / letter transformations
Hill Cipher
Encode and decode with a 2x2 or 3x3 key matrix, multiplying letter blocks mod 26 and inverting the matrix to decode.
Answer first
How do I use a Hill cipher encoder and decoder?
Encode and decode with a 2x2 or 3x3 key matrix, multiplying letter blocks mod 26 and inverting the matrix to decode. Enter the known values and inspect the result immediately. For example, Encode PAYMOREMONEY with the 3x3 key 17 17 5 21 18 21 2 2 19 to get LNSHDLEWMTRW. Use the output to check your reasoning or shortlist a design, then verify the units, assumptions, and real-world limits that apply.
Key matrix
Hill Cipher
C = K × P (mod 26)
Each block of 3 plaintext letters becomes a column vector, multiplied by the key matrix mod 26 to get the ciphertext block. Decoding multiplies by the key’s modular inverse instead - the key matrix must have a determinant that is coprime with 26, or it cannot be inverted.
A classical polygraphic substitution cipher for learning linear algebra and modular arithmetic, not secure encryption. Do not use it to protect real secrets.
Design guide
Use the result with engineering context
Technical content reviewed
When this tool is useful
- Solving a Hill cipher encoder and decoder task without repeating the arithmetic by hand
- Changing one input at a time to understand how it affects the result
What the result includes
- A result calculated from the values and units you enter
- A concrete reference case: Encode PAYMOREMONEY with the 3x3 key 17 17 5 21 18 21 2 2 19 to get LNSHDLEWMTRW.
What the model does not guarantee
- The result depends on the selected width, alphabet, encoding, and input format
- Encoding and number conversion do not provide encryption, authentication, or protection for sensitive data
Worked approach
Try a concrete set of values
Encode PAYMOREMONEY with the 3x3 key 17 17 5 21 18 21 2 2 19 to get LNSHDLEWMTRW. Change one input at a time, confirm the units, and compare the result with an independent calculation or relevant datasheet.
Common decisions
Questions engineers ask
What should I enter in the Hill Cipher?
Use known values in the units shown beside each field. Keep every input within a realistic range and convert units before comparing the result with another source.
Can I use the Hill Cipher result directly?
Encoding and number conversion do not provide encryption, authentication, or protection for sensitive data
How should I verify the Hill Cipher result?
Repeat the worked example, check the units and assumptions, then compare the output with a second calculation, a trusted reference, or a measurement from the real system.
Related build evidence
FireWire Enterprise OTA
See how data formats, device identity, firmware versions, and controlled updates fit into a real embedded platform.
See the projectApply it to real hardware
Need the calculation connected to a working prototype?
Share the requirements, inputs, hardware limits, expected output, and how the result will be tested in the complete system.
Discuss the system