I have been wondering what approach to take in order to figure out what key was used to encrypt a message using the hill cipher. I know it is possible to obtain it even if it were just a known-plaintext attack, so it should be fairly possible for a chosen-plaintext one. I'm trying to figure it out with just intuition, but since I know freq. analysis won't be of help, I don't know what else to try. I want to get my head around this, but could someone point me in the right direction?
- Anybody can ask a question
- Anybody can answer
- The best answers are voted up and rise to the top
Sure. Assuming that you're using the encoding $A = 0$, $B = 1$, etc., just choose your plaintext messages to be the one-block strings:
$$ BA \dots A \\ AB \dots A \\ \vdots \\ AA \dots B $$
The encryptions of these strings will then directly give you the columns of your key matrix.