From: Skybuck Flying on
Hello,

The current rankings are as follows:

Place: Name: Points:
1 Paulo Marques 5
2 Phoenix/Alvo 4
3 Ilmari Karonen 2

CryptoAnalysis Game 5:

Introduction:

According to our intelligence the security of the enemy communication
machines was very weak and has given us reason to believe that the enemy
attack plan is actually a deception. We cannot afford to walk into a trap
and therefore we shall stay in our base until further notice.

Spies deep within enemy territory have uncovered blue prints for what they
believe is the enemies main communication devices.
Our engineers have done their best to construct such devices for further
study !

Furthermore spies have intercepted a message which could be the enemy's true
attack plan !

Once again we call upon you to crack this message ! Here is what we have for
you to work on:

It appears the enemy is using these communication devices:

Device Shuffle:

// initialize
for Index = 1 to Length(Input)
begin
Position[Index] = Index;
end;

// shuffle
// 32 rounds per character
KeyIndex = 1;
for Index = 1 to Length(Input)*32
begin
KeyIndex1 = KeyIndex + 0;
KeyIndex2 = KeyIndex + 1;

if KeyIndex2 > Length(Key)
begin
KeyIndex2 = 1;
end;

Key1 = Key[KeyIndex1];
Key2 = Key[KeyIndex2];

SwapIndex1 = 1 + ((Key1 + (Index-1) + 0) mod Length(Input));
SwapIndex2 = 1 + ((Key2 + (Index-1) + 1) mod Length(Input));

Temp = Position[SwapIndex1];
Position[SwapIndex1] = Position[SwapIndex2];
Position[SwapIndex2] = Temp;

KeyIndex = KeyIndex + 1;

if KeyIndex > Length(Key)
begin
KeyIndex = 1;
end;
end;

Device Encrypt:

Shuffle;

for Index = 1 to Length(Input)
begin
Output[Index] = Input[ Position[Index] ];
end;

Device Decrypt:

Shuffle;

for Index = 1 to Length(Input)
begin
Output[ Position[Index] ] = Input[Index];
end;

The intercepted message is a string of ansi characters:

"tavsafcaseoif i uvmicnele ecfrmge.cshl hk ee ras t te itocehes wh . wt
ehelotIe ie ioM "

(Without the quotation marks "")

The key for the devices is again unknown and heavily guarded and unreachable
for our spies !

From what our engineers understand from these devices, conceptually they
work as follows:

The key is used to shuffle the position array which is initially filled from
1 to N.

The encrypt and decrypt devices construct the same shuffled position array
and use it accordingly to
en-shuffle and de-shuffle the string of characters.

Your objective is clear ! Crack the message and report back to General
Skybuck with your findings as soon as possible !

You will receive +10 points if your provided intelligence is usuable !

Good luck !

Bye,
Skybuck.


From: Skybuck Flying on
To be totally clear for you, the exact intercepted message is:

"tavsafcaseoif i uvmicnele ecfrmge.cshl hk"+
" ee ras t te itocehes wh . wt ehelotIe ie ioM "

Without the quotations marks, and without the plus sign (and without any
carriage returns/line endings/feeds), and concatenated together into one big
string.

Good luck !

Bye,
Skybuck.