Apply a permutation cipher by hand I did the following problem from the book "Cryptography Theory and Practice" as
I am doing some self-study.

Problem:

a) Suppose that $\pi$ is the following permutations of the set $\lbrace 1,\dots,8 \rbrace$:
$$ \pi=\begin{pmatrix}
1 &amp;2&amp; 3&amp; 4&amp; 5&amp; 6&amp; 7&amp; 8\\
4&amp; 1&amp; 6&amp; 2&amp; 7&amp; 3&amp; 8&amp; 5
\end{pmatrix}$$
Compute the permutation $\pi^{-1}$.

b) Decrypt the following cipher text, for a permutation Cipher with
$m = 8$, which was encrypted using the key $\pi$:

${\bf TGEEMNLENNTDROEOAAHDOETCSHAEITLM.}$

Answer:

a)$$ \pi^{-1}=\begin{pmatrix}
1 &amp;2&amp; 3&amp; 4&amp; 5&amp; 6&amp; 7&amp; 8\\
2&amp; 4&amp; 6&amp; 1&amp; 8&amp; 3&amp; 5&amp; 7
\end{pmatrix}$$    

b) To decrypt, I partition the text into groups of 8 giving.

${\bf TGEEMNLE\ \ NNTDROEOA\ \ AHDOETCS\ \ HAEITLM.}$

${\bf TGEEMNLE}$ decrpyts to ${\bf ETNGLEEM.}$

I am fairly sure that this is wrong. However, I do not know what I did wrong.
Please help.

Bob
Apply the $\pi^{-1}$ to all the blocks. Then put them under each other so we get colums of length 4 in this case. Then read out left to right, up to down instead (zig-zag).