1
$\begingroup$

I came across this question:

You are given a permutation cipher defined by the bijection t: N -> N where,

t(i) = i + 10, for i < 10,
t(i) = i - 10, for 10 <= i <= 20, and
t(i) = i, for i > 20.

Assume that the first index is 0, given a message m = 'HELLO WORLD AND THIS IS A SECRET MESSAGE', what is the ciphertext c?

Where the answer was the following:

D AND THISHELLO WORL IS A SECRET MESSAGE

but i don't get how. That's now what we get if the message is spelled out diagonally down and up over a number of rows and then read off row-by-row.

$\endgroup$
2
$\begingroup$

Just apply the given permutation on the string.

Your string is : 'HELLO WORLD AND THIS IS A SECRET MESSAGE'.

Now, to apply the given permutation, we have to shift the first 10 characters rightward by 10 units, and the next 10 characters leftwards by 10 units, while leaving the rest same. Note that you also need to count the spaces.

| cite | improve this answer | |
$\endgroup$
0
$\begingroup$

Let the original message be $m$ and let the ciphertext be $c$. Then $$ c_i = m_{t(i)}. $$ (Or perhaps it's the other way around. For our $t$ it doesn't matter, since it's an involution.)

If you apply this transformation to the given message, you'll get the given ciphertext.

| cite | improve this answer | |
$\endgroup$
  • $\begingroup$ But how..? Could you give an example? For example, the first character is H. Do i add 10 and write the alphabet I get? Like in Rot13? But in that case it's R, not D. $\endgroup$ – x89 Apr 24 at 20:04
  • $\begingroup$ If you spend a few hours on it, surely you'll get it eventually. $\endgroup$ – Yuval Filmus Apr 24 at 20:05
  • $\begingroup$ I think that your problem is that you have a mental picture of what a permutation cipher is, but it doesn't correspond to what's in the question. For you, a permutation cipher changes every A to B (say). In the question, a permutation cipher permutes the order of the letters, in this case exchanging the first 10 letters with the following 10 letters. $\endgroup$ – Yuval Filmus Apr 24 at 20:07
  • $\begingroup$ It's really an exercise in reading comprehension. $\endgroup$ – Yuval Filmus Apr 24 at 20:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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