1
$\begingroup$

I know I should calculate the multiple inverse of plaintext with ciphertext $\pmod {26}$. However, the problem I have is that the plaintext is a $3 \times 4$ matrix which is not square, so how would I get an inverse?

Should I get the inverse of one side (left or right) of the plaintext or is there another way?

$\endgroup$
1

1 Answer 1

0
$\begingroup$

There is definitely a mistake being made somewhere here. I believe you have fundamentally misunderstood how the hill cipher works.

  1. Your plaintext should be a string of characters, not a matrix.
  2. The hill cipher key must be a square matrix, thus cannot be 3x4. The reason for this is as you pointed out, a non-square matrix does not have an inverse thus the ciphertext would not be decryptable.
  3. The hill cipher operates on chunks ("blocks") of the plaintext to encrypt.

No matter what your text is, you should be able to split it into encryptable/decryptable chunks which map between plain and cipher text. The length of each chunk, n, tells you the dimensions of your key matrix (n x n).

$\endgroup$
1
  • $\begingroup$ Thanks for your clarification , I indeed have square key and implemented encryption and decryption, but then I wanted to get the key out of plain and cipher, but I don't know the steps , for example if you have p.t =("thegoldisburiedinorono") and c.t = ("gzscxnvcdjzxeovcrclsrc") what is main steps to get the key (knowing it's "frep")? $\endgroup$ Mar 8 at 10:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.