Pages:
Author

Topic: [Bounty - 0.5 BTC ($500)] Javascript / Password Recovery issue (CLAIMED) - page 3. (Read 2627 times)

full member
Activity: 182
Merit: 100
Completed the solution, tested and it seems to work fine, data you will be getting is not realtime, there will be lag in the updates as it gets larger and larger. I do NOT recommend actually trying to scroll on the browser window or anything, it is JS after all, and literally all the browsers resources are being put towards brute-forcing.

You can set the delay (delaynum, added comment right before it in caps) to whatever value you wish, the higher you'll go, the longer you'll wanna set it. You might wanna consider a progressive delay.

http://pastebin.com/mgGitqLr

Please send to the following address if you're satisfied: 1KU8RFgfVqaqUNTB8uA7MLzbZJTuEwQCQ3

Not the one in my sig please.
hero member
Activity: 630
Merit: 500
Please tip 18xavJxp7Wxs3vjQvLAsfpTyt9RDBin4RB if you are satisfied with the solution

Sent you a tip schalk. Thanks for your efforts, but I think tubbyjr is closest to taking out this bounty.
hero member
Activity: 630
Merit: 500
EDIT2: What happened was my console window actually got too full, once i closed and reopened it, it was showing realtime too. Browser does not hang Smiley.

I can reproduce that experience Smiley It would be cool if this console (on Chrome at least) could be set to only display a certain number of lines and discard the earlier lines! Limiting the console window to 1000 lines or something would be handy.

p.s. On my i7 2600k, doing 8m in Javascript should take about 39 hours. Not great, but at least it's not 39 years. If it turns out I need to check more than 8m, I'll probably start hunting for a c++ (and gpu) solution.

full member
Activity: 182
Merit: 100
Ugh, yes unfortunately I just noticed that :S. I'm trying some workarounds right now to fix it, it's 4:30 am here :p, may be going to sleep soon, but if it's still up for tomorrow, I'll definitely jump on it.
hero member
Activity: 630
Merit: 500

Hi Tubby,

Your progress alert is working how I'd expect, however your code doesn't seem to be actually checking each address against the target. Once the target address is found, it should stop processing and show what phrase generated that address.

I tried your code with the following phrase:

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv

The real bitaddress.org says the address for that is 1KVGuANp3HyH4m6xQYhUV9EWhq6tUVypAG

So, in your html, I input:

a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
abcdefghijklmnopqrstuvwxyz
1KVGuANp3HyH4m6xQYhUV9EWhq6tUVypAG

There are 26 combinations in the above, but your code tries all 26 of them with no 'success', whereas it should have found success on the 23rd 22nd attempt.

My originally supplied code in the OP does properly check the target address and stop processing at that point, so this is functionality that you have broken or removed in your version. If you can put that functionality back in, the bounty would be yours.

Thanks very much.
full member
Activity: 182
Merit: 100
If you wish to tip or pay, please do it to the following address: 1KU8RFgfVqaqUNTB8uA7MLzbZJTuEwQCQ3
hero member
Activity: 630
Merit: 500

Hi schalk,

The only thing yours is doing for me, is posting a javascript alert() saying 'done', at the end of it's run. It is not updating me on the progress of how many have been checked as they're being checked. Did you take a look at how the 'bulk wallet' generate tab works, as suggested in the OP?

I will now take a look at tubbyjr's solution.

Thanks.
full member
Activity: 182
Merit: 100
I'm doing 6M combos at the moment, note, it will take about 30 seconds for it to start up, when doing this many combos. More for 16M ofc.

EDIT: Something odd happened lol, once I passed 5000, the textarea actually updates in realtime now, and console is lagging lol. So you might even wanna consider commenting out the console.log code I added.

EDIT2: What happened was my console window actually got too full, once i closed and reopened it, it was showing realtime too. Browser does not hang Smiley.
full member
Activity: 182
Merit: 100
Here's my solution

http://pastebin.com/NWc2rWWr

Does what you asked for, it does not cause the browser to hang. Updates the combinations, it won't show every increase in text area, due to the code seemingly going to fast for JS to actually constantly update the text area value, but i added code so the progress shows up in your console, in real time. So if you go to web developer tools, and console, you'll see realtime data.
hero member
Activity: 630
Merit: 500
http://pastebin.com/P2ghHZrg# full solution

Please tip 18xavJxp7Wxs3vjQvLAsfpTyt9RDBin4RB if you are satisfied with the solution

EDIT: Sorry just read your previous post about it needing to have the ability to do 16million combinations. I'm unsure if my solution is capable of that.

I think you'd be better off with a desktop application solution as opposed to a javascript one if you're planning on generating upto 16 million bitcoin addresses.

Why would it be incapable of a particular number? The main point is that I should be able to see it's progress without the browser hanging.

If I have no success with 16m, I may even have to go back and try doing a 64m or 128m run... depending on how things go.

I'll take a look at your code now anyway, thank you so much for your efforts.
member
Activity: 126
Merit: 10
Just received my tip, thank you very much OP. I hope you get the solution you're after!
newbie
Activity: 36
Merit: 0
http://pastebin.com/P2ghHZrg# full solution

Please tip 18xavJxp7Wxs3vjQvLAsfpTyt9RDBin4RB if you are satisfied with the solution

EDIT: Sorry just read your previous post about it needing to have the ability to do 16million combinations. I'm unsure if my solution is capable of that.

I think you'd be better off with a desktop application solution as opposed to a javascript one if you're planning on generating upto 16 million bitcoin addresses.
hero member
Activity: 630
Merit: 500
You never explicitly asked for code, just "help" Tongue

Quote
What I need is for this whole thing to be modified

I do appreciate your input Kieran, PM me your address for a tip.
member
Activity: 126
Merit: 10
You never explicitly asked for code, just "help" Tongue No problem, though, I hope my explanation helped rather than confused things.
newbie
Activity: 36
Merit: 0
Can you please leave this bounty for me. I'm closish to having a solution.
hero member
Activity: 630
Merit: 500
I think the main issue is that you are using iteration instead of recursion. If I have time I'll post up a sample that'll help you fix it.

Thank you for your reply schalk and KieranJones1.

Yes, the above was a quick and dirty copy/paste job. I'm familiar with recursion but just feel like paying someone else to do this at the moment rather than spend time on it. As the issue involves my own personal money, I feel too emotionally involved to want to code this myself right now.

I've tried 2048 combinations with no luck, but need a more solid solution that will help me test about 8 or 16m.

Again, anyone able to provide me with a complete solution (rather than just coding help) will be well rewarded.
newbie
Activity: 36
Merit: 0
Here is some code that will allow you too check using recursion:

Code:

function test(target, current, characters, index)
{
if (index == characters.length)
{
if (current == target)
{
console.log("found");
}
return;
}

var currentLetters = characters[index];
for(var i = 0; i < currentLetters.length; i++)
{

test(target, current + currentLetters[i], characters, index + 1);
}
}

// get pass character elements
var characters = [];
var index = 1;
while ($("input[type=text][tabindex='" + index + "']") !== null) {
var value = $("input[type=text][tabindex='" + index + "']").value.toString().replace(/^\s+|\s+$/g, "");
if (value != "") {
characters.push(value);
}
index++;
}

console.log(characters);

var target = document.getElementById("targetaddress").value.toString().replace(/^\s+|\s+$/g, "");
var current = "";

console.log(target);

test(target, current, characters, 0);
member
Activity: 126
Merit: 10
As schalk said, your main issue is using iteration instead of recursion. Here's a much better approach.

First, you'll need some understanding of what is meant by a "graph" in CS. A graph is an organization of nodes and edges. The nodes contain data or represent state, and the edges represent connections between pieces of data or transitions between states. (Apologies if you knew this already, but I figured you were looking for a full explanation.)

For our purposes, think of each letter in the word as a node, and the edges connect in the obvious way, from the first letter to the second, etc. We're going to search the graph for the correct sequence.

For simplicity, let's say that our starting node is empty. Let's pretend your password is some upper/lower combo of abcde, in that order.

So our blank node has two edges, leading to a and A.
a has two edges, leading to b and B
A has two edges, leading to b and B

We'll be using a concept known as depth first search. Essentially, we're going to dive down to the bottom of the graph, because those are the only valid solutions in our case. Assuming you're familiar with how recursion works, you'd have a function that takes a string and a position, where the position refers to the index of the next character to be appended to the string.

When the index is past the end of the string, you have a possible password and you should try it. If not, you return from the function and it unwinds up the stack.

A third parameter would be helpful - a boolean representing whether it should be upper or lower. So you call your search function from the implicit blank node, pass in an empty string, 0, and true - then call it again with an empty string, 0, and false. That will search the entire graph of upper and lower combinations.

Let me know if this is the kind of advice you were looking for! Smiley
newbie
Activity: 36
Merit: 0
I think the main issue is that you are using iteration instead of recursion. If I have time I'll post up a sample that'll help you fix it.
hero member
Activity: 630
Merit: 500
Your link isn't much help as it's thousands of lines of code (why don't you just paste your relevant function rather than the whole of the bitaddress.org webpage that presumably includes your code "somewhere" inside) - but basically you will want to use a timer function for your looping.


Good idea, although I'm so embarrassed by my lack of array usage Smiley

OP updated.

As far as timer usage goes, you're very likely correct that it needs some kind of setTimeout(), however I can't get my own head around how to do it yet. Willing to pay some Javascript guru for the help.
Pages:
Jump to: