Page 1 of 2

Didactic Feedback Cipher Long 2

Posted: Sun Nov 02, 2008 5:41 pm
by Mütze
I'm quite sure, that i solved this challenge. But my password is not accepted.

BTW: There are some errors in the decrypted text, one of the typos is in the
password. Therefore I've tried several possibilities, but without success.

Any hint?

Posted: Sun Nov 02, 2008 6:07 pm
by gfoot
Make sure you've got the endianness right. With wrong endianness, you can get something which is very close to a solution, but has a few wrong letters. So try flipping your key before and after adding 'x' and moduloing.

Posted: Sun Nov 02, 2008 8:28 pm
by Mütze
I found my mistake.

It wasn't related to an endianness problem, but nevertheless your post helped me.

Thanks.

Posted: Sat Nov 08, 2008 5:15 pm
by multiplan
Mütze wrote:I found my mistake.

It wasn't related to an endianness problem, but nevertheless your post helped me.

Thanks.
Lucky guy!

it seems, I've solve the callenge as the same way as you and have same problems as you:
a few "wrong" letters. And, by the way, I can read the sentence, but I have no idea, where the password should be in this sentence. In the callenges before, it was clearly indicated.

The hints form gfoot doesn't talk to me at all. Can you describe your mistake, please. So maybe it helps me to find my mistake.

Posted: Sun Nov 09, 2008 2:04 am
by MerickOWA
Since X and K are 4 bytes long, you have to take 4 bytes from the string and match it up with the 4 bytes of K.

Code: Select all

c = (txt[i] -> txt[i + 3]) ^ k
if you treated k as an array of 4 bytes from least to most significant, the question becomes... does txt get xored with k or k[i+3]? ... This is what is meant by endianness. If you get this wrong, you can get values for K and X which seem right, but as the algorithm decrypts the text, the mathematical addition which happens in the statement

Code: Select all

k = (c + x) % 0x100000000
will not properly carry the overflow bit to the right bytes and will cause your k to be off by 1 on certain bytes which will start of affect your answer.

If your answer looks very close to right but with some corrupted text, try reversing how you match up the 4 bytes of text to the 4 bytes of k... (you'll also have to reverse the bytes of k and x) and see if that fixes your answer.

Posted: Wed Nov 19, 2008 6:50 pm
by abc
Hi all!

First let me explain, that I'm no Englishman -> so, sorry for my bad english language.

Here is the challenge again:

k = {unknown 4-byte value}
x = {unknown 4-byte value}
for (i = 0; i < len(txt); i += 4)
c = (txt -> txt[i + 3]) ^ k
print c
k = (c + x) % 0x100000000

Now my question:
How does this challenge work?

a) (Line: c = (txt -> txt[i + 3]) ^ k)
First byte of Plaintext xor First byte of the 4byte long k
Second byte of Plaintext xor Second byte of the 4byte long k
Third byte of Plaintext xor Third byte of the 4byte long k
Fourth byte of Plaintext xor Fourth byte of the 4byte long k

then:
print as char first result, second result, third result, fourth result (Line: print c)

then: (Line: k = (c + x) % 0x100000000)
first byte of k = (first result + first byte of x) % 256
second byte of k = (second result + second byte of x) % 256
third byte of k = (third result + third byte of x) % 256
fourth byte of k = (fourth result + fourth byte of x) % 256

next bytes...

b) Alternative: (Line: c = (txt -> txt[i + 3]) ^ k)
Byte 1 + Byte 2 + Byte 3 + Byte 4 of Plaintext results in one 4Byte Value.
This 4Byte Value xor 4Byte k

then:
print as char the result (Line: print c)
(But this will only print one char and it will not look meaningful...)

then: (Line: k = (c + x) % 0x100000000)
k=(result + 4Byte x) % 0x100000000

next bytes...

-------------------------------------------------------------------------------------------------------------------

I think that a) is the right method; but then it works with individual 4 Bytes - not with one 4Byte-Value. Modulo with 0x100000000 will not be meaningful with only one Byte.

I still have the "solution" with some wrong letters too, but I don't know how to go on.

Plz give me some explanation, how it works.

Thx in advance
abc

Posted: Wed Nov 19, 2008 7:03 pm
by gfoot
It's more like (b). "print c" means print the 4-byte value c as an 8-digit hex number.

The difference between this an (a) is that in the feedback stage, overflows carry from one byte to another. Which way the overflows carry is important, but I don't remember which way around it should be.

Posted: Tue Dec 02, 2008 8:58 pm
by Andr3w
Another question:
I got a sentence ... but there is no password in it ...
its directly adressed to me ... but no password ...

could anyone please give me a hint ?

Posted: Fri Jan 28, 2011 4:57 pm
by Guderian
i am still missing a few letters due to overflow. any idea how to deal with the overflow? thanks.

Posted: Fri Jan 28, 2011 5:50 pm
by MindFreakz
Well; there are two options; either fix the overflow or try to read/guess the solution based on what you know.

I do have to note; if you want to solve the next challenge as well, fixing the overflow here will give you a head start

Posted: Sun Jan 30, 2011 4:18 am
by Guderian
i guessed the letter but you are right. I managed to fix the overflow. It was just as MerickOWA said. You have to get the endianess right. However the next challenge is much more tricky. I brute forced this one, but this trick isn't going to work there. :-(

Posted: Sat Apr 23, 2011 2:03 pm
by bartim
Hi,

I am stuck in this challenge. There are 4 bytes of the plaintext XORed at once, but there are 189 bytes of encrypted text. Where is that last byte from?

Any tips for me?

(Sorry for my bad english, I'm german)

Posted: Sun Jun 05, 2011 11:48 am
by d6E8bBU5aXHm
bartim wrote:I am stuck in this challenge. There are 4 bytes of the plaintext XORed at once, but there are 189 bytes of encrypted text. Where is that last byte from?
This is confusing for me as well... Could someone comment on this, please?

Posted: Sun Jun 05, 2011 5:52 pm
by laz0r
You can ignore the last byte if you like - I think tails miscalculated when he made the challenge :)

Posted: Sun Jun 05, 2011 10:13 pm
by tails
? I didn't make it.