Didactic Feedback Cipher Long 3

miyako
Posts: 2
Joined: Thu Nov 13, 2008 11:51 pm

Didactic Feedback Cipher Long 3

Post by miyako »

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
miyako
Posts: 2
Joined: Thu Nov 13, 2008 11:51 pm

Post by miyako »

ok, i found the mistake ...
MerickOWA
Posts: 182
Joined: Mon Apr 07, 2008 5:54 pm
Location: HkRkoz al KuwaiT 2019 HaCkEr 101

Post by MerickOWA »

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

Post by MerickOWA »

miyako wrote:ok, i found the mistake ...
Great! :)
Andr3w
Posts: 40
Joined: Tue Nov 04, 2008 4:36 pm
Location: Germany

Post by Andr3w »

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
Allosentient
Posts: 273
Joined: Thu Apr 10, 2008 9:47 pm

Post by Allosentient »

use "long" instead of "int" for 8-byte integer storage.
Andr3w
Posts: 40
Joined: Tue Nov 04, 2008 4:36 pm
Location: Germany

Post by Andr3w »

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

% 0x100000000 is slightly more than 8bytes =(
Karian
Posts: 75
Joined: Wed Jan 09, 2008 10:21 am

Post by Karian »

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

Post by Andr3w »

^^ thanks

i will try to found a c++ class to deal with bigger integers ...
User avatar
m!nus
Posts: 202
Joined: Sat Jul 28, 2007 6:49 pm
Location: Germany

Post by m!nus »

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

Post by MerickOWA »

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

Post by Andr3w »

This hint is really helping me

great ... thanks
Pita
Posts: 1
Joined: Wed May 20, 2009 7:11 pm
Location: Munich

Post by Pita »

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
Felicia
Posts: 1
Joined: Mon Jul 27, 2009 2:11 am

Post by Felicia »

'% 0x100000000' is equal to '& 0xFFFFFFFF', which is 4 bytes
if you want to handle integers greater than 4 bytes, you may use 'long long'
nto
Posts: 6
Joined: Mon Nov 16, 2009 10:31 am

Post by nto »

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.
Post Reply