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



Joined: 13 Nov 2008
Posts: 2

Post Didactic Feedback Cipher Long 3 Reply with quote
i really hate asking for hints, but i'm really stuck
with this one. i'll try to keep it as vague as possible:

obviously a simple brute force won't do the trick
due to the ernormous runtime, so checking subsets
seems to be imperative.

i'm quite sure i have a working peace of code that
checks for "valid" charakters in the rendered
plaintext. but it doesn't find sufficient amounts of
them.

should i expect the deciphered text to be clearly
readable as in the other challenges before?
could anyone give a little hint?

miyako
Wed Dec 03, 2008 3:09 pm View user's profile Send private message
miyako



Joined: 13 Nov 2008
Posts: 2

Post Reply with quote
ok, i found the mistake ...
Wed Dec 03, 2008 5:10 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
Yes, the decrypted text should be clearly readable like in the other problems.

If you're not finding sufficient amounts of valid characters, its possible you're interpreting the encrypted text wrong.

Its possible that you're treating the encrypted text as 4 bytes of a "little-endian" integer instead of 4 bytes of a "big-endian" integer ( or its visa versa, again i can't remember exactly ).

Try doing things the other way and see if that helps.
Wed Dec 03, 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
miyako wrote:
ok, i found the mistake ...


Great! Smile
Wed Dec 03, 2008 5:15 pm View user's profile Send private message
Andr3w



Joined: 04 Nov 2008
Posts: 40
Location: Germany

Post Reply with quote
I cannot solve this challenge ...

So I hope anybody can give me a hint ...

I was trying to solve it with C++ ...

is there a way to handle integers greater than 4 bytes long ?

handle means + ^% and so on ....

by the way i'm an absolute beginner in C++!

thank you
Tue Dec 09, 2008 10:18 pm View user's profile Send private message
Allosentient



Joined: 10 Apr 2008
Posts: 273

Post Reply with quote
use "long" instead of "int" for 8-byte integer storage.
Tue Dec 09, 2008 11:39 pm View user's profile Send private message
Andr3w



Joined: 04 Nov 2008
Posts: 40
Location: Germany

Post Reply with quote
you're right, but in this challenge i need more than 8byte integers ...

% 0x100000000 is slightly more than 8bytes =(
Wed Dec 10, 2008 7:39 am View user's profile Send private message
Karian



Joined: 09 Jan 2008
Posts: 75

Post Reply with quote
IF you need more then 8 bytes, you will have to use something for using bigger integers. In most programming languages, there are packages for using integers of 'infinite' length.

I'm mainly a java programmer so I can't help you to the package for c++. In java you have the BigInteger class to do this.

But offcourse, these packages are a bit slower then the default types, so you better check that you really need them. Maybe their is a way around using it.
Wed Dec 10, 2008 9:04 am View user's profile Send private message
Andr3w



Joined: 04 Nov 2008
Posts: 40
Location: Germany

Post Reply with quote
^^ thanks

i will try to found a c++ class to deal with bigger integers ...
Wed Dec 10, 2008 9:58 am View user's profile Send private message
m!nus



Joined: 28 Jul 2007
Posts: 202
Location: Germany

Post Reply with quote
Andr3w wrote:
you're right, but in this challenge i need more than 8byte integers ...

% 0x100000000 is slightly more than 8bytes =(
% 0x100000000 is 4 byte if i'm not totally mistaken
Wed Dec 10, 2008 2:32 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
If you use int's or unsigned int's in C++ theres no need to do a % 0x100000000. This is what is done automatically by the CPU using integer math. Example: 0xffffffff + 1 == 0

The only reason the example code has a "% 0x100000000" in it, is that it is written in python, which supports "big numbers/integers" which allow for exact precision on numbers which can be as big as the memory will allow, therefore it wont wrap around like C++ ints will.
Wed Dec 10, 2008 2:32 pm View user's profile Send private message
Andr3w



Joined: 04 Nov 2008
Posts: 40
Location: Germany

Post Reply with quote
This hint is really helping me

great ... thanks
Thu Dec 11, 2008 3:02 pm View user's profile Send private message
Pita



Joined: 20 May 2009
Posts: 1
Location: Munich

Post Reply with quote
5 bytes are the right answer. The one is excatly after the 4 bytes. So when you do % 0x100000000. It's the same as a bufferoverflow with 4 bytes

m!nus wrote:
Andr3w wrote:
you're right, but in this challenge i need more than 8byte integers ...

% 0x100000000 is slightly more than 8bytes =(
% 0x100000000 is 4 byte if i'm not totally mistaken

Sun May 24, 2009 2:06 pm View user's profile Send private message
Felicia



Joined: 27 Jul 2009
Posts: 1

Post Reply with quote
'% 0x100000000' is equal to '& 0xFFFFFFFF', which is 4 bytes
if you want to handle integers greater than 4 bytes, you may use 'long long'
Sun Sep 20, 2009 8:09 am View user's profile Send private message
nto



Joined: 16 Nov 2009
Posts: 6

Post Reply with quote
Allosentient wrote:
use "long" instead of "int" for 8-byte integer storage.


That depends entirely on the compiler used. In my environment sizeof(long) is 4 bytes. You should use a long long if you want a guaranteed size of at least 8.
Fri Dec 11, 2009 10:06 am 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.