hacker.org Forum Index
RegisterSearchFAQMemberlistUsergroupsLog in
Didactic Feedback Cipher Long 2
Goto page 1, 2  Next
 
Reply to topic    hacker.org Forum Index » Challenges View previous topic
View next topic
Didactic Feedback Cipher Long 2
Author Message
Mütze



Joined: 26 Oct 2008
Posts: 23

Post Didactic Feedback Cipher Long 2 Reply with quote
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?
Sun Nov 02, 2008 5:41 pm View user's profile Send private message
gfoot



Joined: 05 Sep 2007
Posts: 269
Location: Brighton, UK

Post Reply with quote
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.
Sun Nov 02, 2008 6:07 pm View user's profile Send private message
Mütze



Joined: 26 Oct 2008
Posts: 23

Post Reply with quote
I found my mistake.

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

Thanks.
Sun Nov 02, 2008 8:28 pm View user's profile Send private message
multiplan



Joined: 07 Nov 2008
Posts: 2

Post Reply with quote
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.
Sat Nov 08, 2008 5:15 pm View user's profile Send private message
MerickOWA



Joined: 07 Apr 2008
Posts: 182
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post Reply with quote
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:
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[i] get xored with k[i] 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:
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.
Sun Nov 09, 2008 2:04 am View user's profile Send private message
abc



Joined: 02 Nov 2008
Posts: 12

Post Reply with quote
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[i] -> txt[i + 3]) ^ k
print c
k = (c + x) % 0x100000000

Now my question:
How does this challenge work?

a) (Line: c = (txt[i] -> 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[i] -> 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
Wed Nov 19, 2008 6:50 pm View user's profile Send private message
gfoot



Joined: 05 Sep 2007
Posts: 269
Location: Brighton, UK

Post Reply with quote
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.
Wed Nov 19, 2008 7:03 pm View user's profile Send private message
Andr3w



Joined: 04 Nov 2008
Posts: 40
Location: Germany

Post Reply with quote
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 ?
Tue Dec 02, 2008 8:58 pm View user's profile Send private message
Guderian



Joined: 25 Jan 2011
Posts: 18
Location: Greece

Post Reply with quote
i am still missing a few letters due to overflow. any idea how to deal with the overflow? thanks.
Fri Jan 28, 2011 4:57 pm View user's profile Send private message
MindFreakz



Joined: 08 Dec 2010
Posts: 8

Post Reply with quote
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
Fri Jan 28, 2011 5:50 pm View user's profile Send private message
Guderian



Joined: 25 Jan 2011
Posts: 18
Location: Greece

Post Reply with quote
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. Sad
Sun Jan 30, 2011 4:18 am View user's profile Send private message
bartim



Joined: 02 Apr 2011
Posts: 1

Post Reply with quote
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)
Sat Apr 23, 2011 2:03 pm View user's profile Send private message
d6E8bBU5aXHm



Joined: 26 Oct 2008
Posts: 2

Post Reply with quote
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?
Sun Jun 05, 2011 11:48 am View user's profile Send private message
laz0r



Joined: 04 Feb 2010
Posts: 290
Location: Within the depths of Unix

Post Reply with quote
You can ignore the last byte if you like - I think tails miscalculated when he made the challenge Smile

_________________
There is no spoon.
Sun Jun 05, 2011 5:52 pm View user's profile Send private message
tails



Joined: 10 Jun 2008
Posts: 191
Location: Tokyo

Post Reply with quote
? I didn't make it.
Sun Jun 05, 2011 10:13 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    hacker.org Forum Index » Challenges All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.