stream cipher breaking problem 132

Back to Problem Solutions forum

colin_mcnicholl     2019-07-23 10:22:16

Hi Rodion,

With the example input I have got as far as identifying a partially decrypted message:

?space?M?ON?D?TY

That is index 1: whitespace, index 3: M (should be lowercase though !?) index 5: O index 6: N index 8: D index 10: T index 11: Y

The expected output is 'I am on duty'.

Not sure why I have got capital letters and expected answer is lowercase.

In addition I think the key values are: index 1: 120 index 3: 145 index 5: 139 index 6: 83 index 8: 31 index 10: 83 index 11: 94

The problem states:

"Note that you could not expect all bytes of the key to be found programmatically. So you will probably get not completely decrypted message at first but then you will be able to substitute some missing or wrong letters and find out more values of the key."

I cannot figure out how this substitution should be done.

I guess for:

D TY

for example I could substitute each letter of the alphabet A through Z, compare result to a dictionary of words and see which result in a 'valid' word.

But then I could end up looking at:

M ON

and get, say, MOON

so I suspect another approach is needed.

I thought about trying to figure out the formula for key generation from the sequence:

,120,,145,,139,83,,31,_,83,94

but not sure how to do that.

Any pointers?

pearl_barley     2019-07-31 09:16:57
User avatar

Hey Rodion. This tread is forggotten?

I also read problem but not understood to the end.

I try xor evry line to evry line and with excample (i am on duty) I got

0^1=---SS----S-SS----
0^2=---------S-S----
1^2=---SS-------S---
0^3=----SS--S--SS---
1^3=---S-S--SS------
2^3=----SS--SS--S---
0^4=----S-S----S----
1^4=---S--S--S--S---
2^4=----S-S--S------
3^4=-----SS-S---S---
0^5=----------SS---
1^5=---SS----SS-S--
2^5=---------SS----
3^5=----SS--S-S-S--
4^5=----S-S---S----
0^6=-S-----S---S
1^6=-S-SS--S-S--
2^6=-S-----S-S--
3^6=-S--SS-SS---
4^6=-S--S-SS----
5^6=-S-----S--S-

Colin say he has problem with 3-rd and 5-rd letter from end. I think we esily notice the fifth is space in the last line becauze it makes xor more then 64 with evry other. It harder with third, seem both 1-st and 2 line hase space here, but can detect anyway. I don't know yet how do this in program.

But how do with 1 and 3 char from the begin? no space here?

PS thank to that problem i learned how do array in array in perl )))

Rodion (admin)     2019-07-31 10:30:34
User avatar

Oops, yes, thanks Friends - I think I've seen this post but due to some confusion it mixed in my mind with the suffix array discussion.

Well, let me some time please to recollect this problem and I hope I'll be back with any ideas I have.

Not sure why I have got capital letters

At a glance, if there are only letters and spaces, we get capital instead of small and vice versa if it is xored with space. E.g. we should not forget to exclude this xored space by xoring it out once more.

Codes for capital letters in binary look like 10xxxxx and for small letters they are 11xxxxx. The space is 0100000 - so we see it "toggles" the 5-th bit when xored to a letter and hence this conversion.

colin_mcnicholl     2019-08-01 09:10:03

Hi Rodion,

Thanks for response and explanation.

I have started reading a book 'The Code Book' by Simon Singh. It is mainly about the history of cryptography but nevertheless interesting and is giving me a better appreciation of the subject.

I suspect to solve this problem I am expected to apply some cipher breaking skills to the partial answer from my program and not to expect to get a full answer from the program.

If after recollecting the problem you have anything to add it would of course be of interest.

Please login and solve 5 problems to be able to post at forum