Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Find the Hill cipher key matrix $K$ that can realize the permutation $$f: (1,2,3,4,5) \to (3,5,1,4,2).$$

I am not sure how to find a $5\times 5$ matrix that satisfies this. My guess is

$$K=\begin{bmatrix} 0 & 0 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 1\\ 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0\\0 & 1 & 0 & 0 & 0\\ \end{bmatrix}.$$

I am not sure if this is correct.

share|improve this question
    
Could you please clarify what are the alphabet and the block length? –  Andreas Caranti Feb 16 '13 at 18:29
1  
The alphabet is A-Z so it will be mod 26, I am not sure about the block length. –  Dreamer78692 Feb 16 '13 at 18:41
    
Now, wouldn't the block size here be $5$? –  Thomas Feb 16 '13 at 19:03
1  
I think your matrix is quite ok. –  Seyhmus Güngören Feb 16 '13 at 19:03

1 Answer 1

up vote 1 down vote accepted

I hope that I understand you question right. The block size corresponds to the size of the matrix. So the block size in this case is five.

When your key is $K$ and your plaintext is for example $HELLO$ corresponding to the vector $$ \pmatrix{8 \\ 5 \\ 12\\ 12\\ 15} $$ then you get $$ \pmatrix{ 0 & 0 & 1 & 0 & 0\\0 & 0 & 0 & 0 & 1\\ 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 1 & 0\\0 & 1 & 0 & 0 & 0} \pmatrix{8 \\ 5 \\ 12\\ 12\\ 15} = \pmatrix{12\\15\\8\\12\\5}.$$ So the ciphertext is $LOHLE$. This corresponds exactly to the permutation that you gave.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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