Didactic Feedback Cipher Long 2

Mütze
Posts: 23
Joined: Sun Oct 26, 2008 2:39 pm

Didactic Feedback Cipher Long 2

Post 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?
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post 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.
Mütze
Posts: 23
Joined: Sun Oct 26, 2008 2:39 pm

Post by Mütze »

I found my mistake.

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

Thanks.
multiplan
Posts: 2
Joined: Fri Nov 07, 2008 10:08 am

Post 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.
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post 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.
abc
Posts: 12
Joined: Sun Nov 02, 2008 8:40 pm

Post 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
gfoot
Posts: 269
Joined: Wed Sep 05, 2007 11:34 pm
Location: Brighton, UK

Post 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.
Andr3w
Posts: 40
Joined: Tue Nov 04, 2008 4:36 pm
Location: Germany

Post 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 ?
Guderian
Posts: 18
Joined: Tue Jan 25, 2011 4:31 pm
Location: Greece

Post by Guderian »

i am still missing a few letters due to overflow. any idea how to deal with the overflow? thanks.
MindFreakz
Posts: 8
Joined: Wed Dec 08, 2010 7:39 pm

Post 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
Guderian
Posts: 18
Joined: Tue Jan 25, 2011 4:31 pm
Location: Greece

Post 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. :-(
bartim
Posts: 1
Joined: Sat Apr 02, 2011 11:24 am

Post 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)
d6E8bBU5aXHm
Posts: 2
Joined: Sun Oct 26, 2008 6:00 pm

Post 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?
User avatar
laz0r
Posts: 290
Joined: Thu Feb 04, 2010 4:18 pm
Location: Within the depths of Unix

Post by laz0r »

You can ignore the last byte if you like - I think tails miscalculated when he made the challenge :)
There is no spoon.
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

? I didn't make it.
Post Reply