Didatic Feedback Cipher Long 2

Post Reply
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Didatic Feedback Cipher Long 2

Post by MerickOWA »

This challenge done on big endian or little endian machine?

or to be more specific..

(txt -> txt[i + 3]) ^ k

would txt correspond to the least significant byte of k or the most?
niteria
Posts: 11
Joined: Thu Feb 14, 2008 8:02 pm
Contact:

Post by niteria »

I would be happy if I knew what "->" means.
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

Shhh! :D

The endianness is the most interesting factor of this challenge. The real key is whether you get aware of it, rather than finding the value of x. So why don't you try both?
therethinker
Posts: 144
Joined: Fri Mar 28, 2008 11:29 pm
Location: #hacker.org on Freenode

Post by therethinker »

@niteria: hopefully I'm not disclosing too much info by saying this... but I don't think the point of the challenge was to understand the -> symbol, so I should be fine :P

Its best explained with an example... lets say txt = {0x12, 0xab, 0xcd, 0xef}, then txt[0] -> txt[3] would be 0x12abcdef.
niteria
Posts: 11
Joined: Thu Feb 14, 2008 8:02 pm
Contact:

Post by niteria »

thanks, i was too lazy to guess it
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

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 // => mod to 1 byte length
wouldn't be the c in the second iteration be 3 plain bytes and one XORed? seems strange to me
tails
Posts: 191
Joined: Tue Jun 10, 2008 7:51 pm
Location: Tokyo

Post by tails »

m!nus wrote: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 // => mod to 1 byte length
wouldn't be the c in the second iteration be 3 plain bytes and one XORed? seems strange to me

Maybe you are dividing instead of modding.
Post Reply