Author

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

hero member
Activity: 630
Merit: 500
Make sure to say I'm not welcome there, too.

That's entirely up to you and how you decide to enter the discussion.
member
Activity: 98
Merit: 10
nearly dead
I decline my tip, give it to someone else that needs.

Sure thing - I'll need it myself if I don't end up cracking this damn password Cheesy


If you're serious into it, you shouldn't be doing this in javascript.

Thanks, I'll get serious if 8m doesn't yield a result.

At that point I'll post a new bounty for some hardcore gpu coding and test a few billion.


Make sure to say I'm not welcome there, too.
hero member
Activity: 630
Merit: 500
I decline my tip, give it to someone else that needs.

Sure thing - I'll need it myself if I don't end up cracking this damn password Cheesy


If you're serious into it, you shouldn't be doing this in javascript.

Thanks, I'll get serious if 8m doesn't yield a result.

At that point I'll post a new bounty for some hardcore gpu coding and test a few trillion.
member
Activity: 98
Merit: 10
nearly dead
I decline my tip, give it to someone else that needs.

Sure thing - I'll need it myself if I don't end up cracking this damn password Cheesy


If you're serious into it, you shouldn't be doing this in javascript.
hero member
Activity: 630
Merit: 500
I decline my tip, give it to someone else that needs.

Sure thing - I'll need it myself if I don't end up cracking this damn password Cheesy
member
Activity: 98
Merit: 10
nearly dead
I decline my tip, give it to someone else that needs.
newbie
Activity: 36
Merit: 0
No, that isn't necessary. If we were updating the DOM constantly then yes maybe 0 might make it crash. But mine doesn't update the DOM constantly. I've been running mine for 75685 combinations so far and it's still going smoothly.

For performance I also compare the PubKeyHash instead of the actual bitcoin address (won't make a hell of a lot of difference, but every little bit helps).

EDIT: Alright - thanks for the tip!
hero member
Activity: 630
Merit: 500

this worked properly when I fed it something with 2^11 (2048) combos, but hung the browser when i tried 2^23 (8m).

It just sits there not responding after clicking [view], and then finally I get a popup telling me it's not responding and would I like to kill it.


I know you hate me and all for whatever reason, but if you tried running the earlier code I gave you will notice it can handle 2^23 and other inputs without killing the browser. Obviously it will take a long time because generating addresses in javascript is slow.

I don't hate people who haven't matured yet. I've been there before, myself.

I will take a look at your code now and give praise where praise is due. Thanks.


Thanks for at least taking a look at it.

With your earlier example, it stops at (abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv) Combinations tried: 22 out of 26 and shows the match, btw.

Well this does work as described thanks, although I won't be using it as it's 20x slower than tubby's.

Anyway, I've actually done the last little bit of tubby's code myself, so I have everything I need now.

Thanks everyone for your efforts and participation, I'm sending out coins like this:


The code I'll be actually using (with my own tiny mod):

Tubbyjr: 0.4 BTC


Had a good crack at this, but ultimately I won't be using his code:

Schalk: 0.1 BTC


Tips (Let me know your address if you haven't already):

KieranJones1: 0.005 BTC
Ciyam: 0.005 BTC
Moderate: 0.005 BTC - Try not to come off so harsh next time, and your coding will take you far, I'm sure.

member
Activity: 98
Merit: 10
nearly dead

note when I recoded it I made sure to make sure it performs fast. As you'll notice with large combinations (like 10,000,000 mine will perform around 5 times faster than moderate's solution on chrome on my computer).


Is the benchmark available somewhere ? Which line(s) make it faster/slower ?

EDIT: Nevermind, I see you just did a    setTimeout(asyncBitcoinAddressCheck, 0). I guess you didn't see the default timeout at my code is 100 ms ? That's what make it not kill the browser.
newbie
Activity: 36
Merit: 0
Sorry, this should fix the issue - http://privatepaste.com/42e170b0cb

Please note when I recoded it I made sure to make sure it performs fast. As you'll notice with large combinations (like 10,000,000 mine will perform around 5 times faster than moderate's solution on chrome on my computer).

I tested it and it should take 41.67 hours to solve 8,000,000 combinations (on my computer).
member
Activity: 98
Merit: 10
nearly dead

this worked properly when I fed it something with 2^11 (2048) combos, but hung the browser when i tried 2^23 (8m).

It just sits there not responding after clicking [view], and then finally I get a popup telling me it's not responding and would I like to kill it.


I know you hate me and all for whatever reason, but if you tried running the earlier code I gave you will notice it can handle 2^23 and other inputs without killing the browser. Obviously it will take a long time because generating addresses in javascript is slow.

I don't hate people who haven't matured yet. I've been there before, myself.

I will take a look at your code now and give praise where praise is due. Thanks.


Thanks for at least taking a look at it.

With your earlier example, it stops at (abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv) Combinations tried: 22 out of 26 and shows the match, btw.
hero member
Activity: 630
Merit: 500

this worked properly when I fed it something with 2^11 (2048) combos, but hung the browser when i tried 2^23 (8m).

It just sits there not responding after clicking [view], and then finally I get a popup telling me it's not responding and would I like to kill it.


I know you hate me and all for whatever reason, but if you tried running the earlier code I gave you will notice it can handle 2^23 and other inputs without killing the browser. Obviously it will take a long time because generating addresses in javascript is slow.

I don't hate people who haven't matured yet. I've been there before, myself.

I will take a look at your code now and give praise where praise is due. Thanks.
member
Activity: 98
Merit: 10
nearly dead

this worked properly when I fed it something with 2^11 (2048) combos, but hung the browser when i tried 2^23 (8m).

It just sits there not responding after clicking [view], and then finally I get a popup telling me it's not responding and would I like to kill it.


I know you hate me and all for whatever reason, but if you tried running the earlier code I gave you will notice it can handle 2^23 and other inputs without killing the browser. Obviously it will take a long time because generating addresses in javascript is slow.
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.


Isn't this the unexpected result?

Shouldn't it just check:
abcdefghijklmnopqrstua
abcdefghijklmnopqrstub
abcdefghijklmnopqrstuc
,,,
abcdefghijklmnopqrstuz

so it will never check abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv?

No, the pass is always 48 chars long (That's what the 48 input boxes are for).

It'll check:

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstua
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstub
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuc

...

It should stop processing when it reaches the correct one (22nd attempt):

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv  -> This creates the bitcoin address 1KVGuANp3HyH4m6xQYhUV9EWhq6tUVypAG

even though there are 4 more combos...

abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuw
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstux
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuy
abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuz
hero member
Activity: 630
Merit: 500
newbie
Activity: 36
Merit: 0

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.


Isn't this the unexpected result?

Shouldn't it just check:
abcdefghijklmnopqrstua
abcdefghijklmnopqrstub
abcdefghijklmnopqrstuc
,,,
abcdefghijklmnopqrstuz

so it will never check abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuv?
newbie
Activity: 36
Merit: 0
Hi Cyberdyne

I have made it so that it shows the progress - http://privatepaste.com/683603b43b

The core of this code is:

Code:
// we want to find the passcode for this bitcoin address
var target = document.getElementById("targetaddress").value.toString().replace(/^\s+|\s+$/g, "");
//var target = "1Eq8Ucu2ugn4owQZ8RUybrA3Cm2Bo7Zzac";

// passphrase search data
var inputElements = document.getElementsByTagName("input");
var searchData = [];
for(var i = 0; i < inputElements.length; i++) {
if (inputElements[i].getAttribute("data-role") == "passPhraseChar") {
var value = inputElements[i].value.toString().replace(/^\s+|\s+$/g, "");
if (value != "") {
searchData.push(value);
}
}
}
//var searchData = ["a", "pP", "pP", "l", "e"];

// we will use a pubKeyHash for comparing when generating an address (this saves the step of base58 encoding when generating an address)
// decode address to base58 and extract just the pubKeyHash (so remove the first number and checksum at the end of the address)
var targetPubKeyHash = Bitcoin.Base58.decode(target);
targetPubKeyHash = targetPubKeyHash.splice(1, targetPubKeyHash.length - 5);

// calculate total combinations
var totalCombinations = 0;
var totalIterations = 0;
var divisors = new Array();
divisors[0] = 1;
for(var i = 0; i < searchData.length; i++) {
if (i === 0) {
totalCombinations = searchData[i].length;
totalIterations = totalCombinations;
} else {
totalCombinations = totalCombinations  * searchData[i].length;
totalIterations += totalCombinations;
}
divisors[i + 1] = totalCombinations;
}


var amountOfTimesToUpdate = 1000;
var updateIncrements = totalCombinations / amountOfTimesToUpdate;
var nextUpdate = updateIncrements;

var i = 0;
(function asyncBitcoinAddressCheck() {

    var checkphrase = "";
for(var n = 0; n < searchData.length; n++) {
var index = Math.floor(i / divisors[n]) % searchData[n].length;
checkphrase += searchData[n][index];
}

var bytes = Crypto.SHA256(checkphrase, { asBytes: true });
var btcKey = new Bitcoin.ECKey(bytes);
var pubKeyHash = btcKey.getPubKeyHash();
var found = true;
for(var j = 0; j < pubKeyHash.length; j++) {
if (pubKeyHash[j] != targetPubKeyHash[j]) {
found = false;
}
}

if (found) {
var privWif = btcKey.getBitcoinWalletImportFormat();
var bitcoinAddress = btcKey.getBitcoinAddress();
        document.getElementById("brainbtcaddress").innerHTML = bitcoinAddress;
        document.getElementById("brainbtcprivwif").innerHTML = privWif;
        ninja.qrCode.showQrCode({
                        "brainqrcodepublic": bitcoinAddress,
                        "brainqrcodeprivate": privWif
                    });
        document.getElementById("brainkeyarea").style.visibility = "visible";
alert("Password is " + checkphrase);
return;
}

    if (i < totalCombinations) {
i++;
if (i > nextUpdate) {
nextUpdate += updateIncrements;
document.getElementById("bulktextarea2").value = "Checking combination " + (i + 1) + " out of " + totalCombinations + " (" + (Math.round( i / totalCombinations * 1000 ) / 10) + "%)";
setTimeout(asyncBitcoinAddressCheck, 0);
} else {
asyncBitcoinAddressCheck();
}
    }
})();

document.getElementById("bulktextarea2").value = "Checking combination " + totalCombinations + " out of " + totalCombinations + " (100%)";

Regards
Schalk
hero member
Activity: 630
Merit: 500
I already contributed proper working code at https://bitcointalksearch.org/topic/m.3766027

Well - best of luck with that.


I'm just going to wait for tubbyjr to take a nap and get back to me. His copy is 90% of the way there.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
member
Activity: 98
Merit: 10
nearly dead
No-one posted code that included the OP code so your "blindly following" comment makes little sense.

If you are keen to contribute then how about just focus on the solution?

Yes, someone did... see http://pastebin.com/mgGitqLr from https://bitcointalksearch.org/topic/m.3764612. My initial quote was taken directly from it.

I already contributed proper working code at https://bitcointalksearch.org/topic/m.3766027
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
No-one posted code that included the OP code so your "blindly following" comment makes little sense.

If you are keen to contribute then how about just focus on the solution?
member
Activity: 98
Merit: 10
nearly dead
Since some posts ago I'm not counting on the reward here, just tried to make a point about the code quality.

And as I already pointed out your comment about the "code quality" was completely unnecessary as the OP had already admitted his code was bad and needed re-doing.


This is taking so long to settle, maybe we should do it somewhere else. The code quality I'm referring, if it is not clear from the collection of earlier replies, is about the non-working-code that blindly followed the OP code.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
Since some posts ago I'm not counting on the reward here, just tried to make a point about the code quality.

And as I already pointed out your comment about the "code quality" was completely unnecessary as the OP had already admitted his code was bad and needed re-doing.
member
Activity: 98
Merit: 10
nearly dead
That is no reason for someone to go and build upon that.

Exactly why he asked for it to be "re-written" (not "built upon" as all the other replies already said).

It is probably just an age thing but if you want to get a reward I would recommend more code and less negative comments (you should note that you are not being criticized about your code).


I'm not sure to which one of us you are referring about the age, but you might check that the current (non-working-)solution at the time of my post was (and still is) using the code I quoted. I never mentioned the OP there.

Since some posts ago I'm not counting on the reward here, just tried to make a point about the code quality.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
That is no reason for someone to go and build upon that.

Exactly why he asked for it to be "re-written" (not "built upon" as all the other replies already said).

It is probably just an age thing but if you want to get a reward I would recommend more code and less negative comments (you should note that you are not being criticized about your code).
member
Activity: 98
Merit: 10
nearly dead
I'm sorry but I don't think saying "There should be some trivial criteria for code quality here" is an insult, but I certainly was insulted after that. The code is there, anyone is free to use it or ignore it based on unfounded name calling.

Did you not read his OP and the immediate follow up to my post?

He stated his code was badly written - so your rubbish about "code quality" is completely OT as he had already admitted the code needed re-writing.


I actually did read it, and saw he said he was embarrassed about it.

That is no reason for someone to go and build upon that.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
I'm sorry but I don't think saying "There should be some trivial criteria for code quality here" is an insult, but I certainly was insulted after that. The code is there, anyone is free to use it or ignore it based on unfounded name calling.

Did you not read his OP and the immediate follow up to my post?

He stated his code was badly written - so your rubbish about "code quality" is completely OT as he had already admitted the code needed re-writing.

You were "insulted" probably because either you didn't pay any attention to the OP and the following 2 posts or your ego (will let you choose which).
member
Activity: 98
Merit: 10
nearly dead
You can also ignore me, but you can't ignore the validity of the earlier statements. If you want some proper working clean code:

Hmm... I think if you posted the code first rather than the insults you might have had a better chance.


I'm sorry but I don't think saying "There should be some trivial criteria for code quality here" is an insult, but I certainly was insulted after that. The code is there, anyone is free to use it or ignore it based on unfounded name calling.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
You can also ignore me, but you can't ignore the validity of the earlier statements. If you want some proper working clean code:

Hmm... I think if you posted the code first rather than the insults you might have had a better chance.
member
Activity: 98
Merit: 10
nearly dead
In this case it is irrelevant what your opinion is, a crap code remains crap even after you label other guys in the forum.

Thank you for reminding me to always check the 'self moderate' option.

I'm genuinely appreciative of that.


You can also ignore me, but you can't ignore the validity of the earlier statements. If you want some proper working clean code:

Code:
view: function () {

                    if (!String.prototype.trim) {
                        String.prototype.trim = function() {
                            return this.replace(/^\s+|\s+$/g, '');
                        };
                    }
                    var plist = [];
                    for (var i = 1; i <= 48; i++) {
                        var pi = document.getElementById("passphrasechar_" + i);
                        var val = pi.value.toString().trim();
                        if (val) {
                            plist.push(val);
                        }
                    }
                    var target = document.getElementById("targetaddress").value.toString().trim();

                    function LazyProduct(sets) {
                        var total = 1;
                        var dm = [], len;
                        for (i = sets.length; i--; ) {
                            len = sets[i].length;
                            dm[i] = [total, len];
                            total *= len;
                        }
                        this.length = total;

                        this.item = function(n) {
                            var c = [];
                            for (var i = sets.length; i--; ) {
                                c[i] = sets[i][Math.floor(n / dm[i][0]) % dm[i][1]];
                            }
                            return c.join('');
                        };
                    };

                    var bytes;
                    var btcKey;
                    var bitcoinAddress;

                    var lz = new LazyProduct(plist);
                    var timeout_check = 100;
                    var check_i = 0;
                    function check() {
                        var checkphrase = lz.item(check_i);
                        check_i++;

                        bytes = Crypto.SHA256(checkphrase, { asBytes: true });
                        btcKey = new Bitcoin.ECKey(bytes);
                        bitcoinAddress = btcKey.getBitcoinAddress();
                      
                        document.getElementById("bulktextarea2").value = "(" + checkphrase + ") Combinations tried: " + check_i + " out of " + lz.length;
                      
                        if (bitcoinAddress == target) {
                            var privWif = btcKey.getBitcoinWalletImportFormat();
                            document.getElementById("brainbtcaddress").innerHTML = bitcoinAddress;
                            document.getElementById("brainbtcprivwif").innerHTML = privWif;
                            ninja.qrCode.showQrCode({
                                "brainqrcodepublic": bitcoinAddress,
                                "brainqrcodeprivate": privWif
                            });
                            document.getElementById("brainkeyarea").style.visibility = "visible";
                        } else {
                            /* Continue searching. */
                            if (check_i >= lz.length) {
                                document.getElementById("bulktextarea2").value = "Not found";
                            } else {
                                setTimeout(check, timeout_check);
                            }
                        }
                    };
                    setTimeout(check, timeout_check);
}, /* view */

HTML part remains the same.
hero member
Activity: 630
Merit: 500
In this case it is irrelevant what your opinion is, a crap code remains crap even after you label other guys in the forum.

Thank you for reminding me to always check the 'self moderate' option.

I'm genuinely appreciative of that.
member
Activity: 98
Merit: 10
nearly dead
I'm patching the OPs code, as per his request.

Anyone that can actually code anything would never work on that, instead would do a proper implementation. I could provide an actual clean solution, but if OP is fine with that then whatever, it is his bounty after all.

I'd never hire a troll, no matter how skilled.

People skills come first, then coding prowess comes in second.


In this case it is irrelevant what your opinion is, a crap code remains crap even after you label other guys in the forum.
hero member
Activity: 630
Merit: 500
I'm patching the OPs code, as per his request.

Anyone that can actually code anything would never work on that, instead would do a proper implementation. I could provide an actual clean solution, but if OP is fine with that then whatever, it is his bounty after all.

I'd never hire a troll, no matter how skilled.

People skills come first, then coding prowess comes in second.
hero member
Activity: 630
Merit: 500
Sorry, meant target. Note, it will be fastest when all characters are utilized, with your test, of having only one character, having more than 1 letter, at the current delay, it will go about 1500ms, for each combo. But when you utilize all 48, it will be 1500/48ms per combo. You adjust the delaynum to whatever suits you, I chose a high safe number, as I said, with it I reached 2M no prob, on my Q6600, although it is OC'd to 3.3 GhZ

Where do I put that? Could you please post your completed solution? Also, an alert() will not be appropriate for outputting the winning phrase, because I won't be able to copy it to the clipboard from there.

My copy used to just print it out in the big text area when it found it.

Thanks.
member
Activity: 98
Merit: 10
nearly dead
I'm patching the OPs code, as per his request.

Anyone that can actually code anything would never work on that, instead would do a proper implementation. I could provide an actual clean solution, but if OP is fine with that then whatever, it is his bounty after all.
full member
Activity: 182
Merit: 100
Sorry, meant target. Note, it will be fastest when all characters are utilized, with your test, of having only one character, having more than 1 letter, at the current delay, it will go about 1500ms, for each combo. But when you utilize all 48, it will be 1500/48ms per combo. You adjust the delaynum to whatever suits you, I chose a high safe number, as I said, with it I reached 2M no prob, on my Q6600, although it is OC'd to 3.3 GhZ
hero member
Activity: 630
Merit: 500
Also, here's an easy way for it to notify you of solution, just put it after bitcoinAddress = ....

Code:
if(bitcoinAddress == checkphrase)
alert(checkphrase);


It found the solution to the previous problem, and actually, it's running quite efficiently going to a combo of 2M, I thought it was laggy, but I had several applications, a game, and browsers open, so that was seemingly causing me the lag. Updating almost at real time now. I'm able to scroll the window and everything Smiley.

bitcoinAddress should never be equal to checkphrase, i think you mean 'target'.

Thanks for your help, I'll try your new copy now.
full member
Activity: 182
Merit: 100
Your spam is unneeded here, I'm patching the OPs code, as per his request. If you have nothing better to do than troll, be gone.
member
Activity: 98
Merit: 10
nearly dead
Is this for real ?

Code:
var passphrasechar_1 = document.getElementById("passphrasechar_1").value.toString().replace(/^\s+|\s+$/g, ""); // trim white space
var passphrasechar_2 = document.getElementById("passphrasechar_2").value.toString().replace(/^\s+|\s+$/g, ""); // trim white space
var passphrasechar_3 = document.getElementById("passphrasechar_3").value.toString().replace(/^\s+|\s+$/g, ""); // trim white space
var passphrasechar_4 = document.getElementById("passphrasechar_4").value.toString().replace(/^\s+|\s+$/g, ""); // trim white space

...

var len_1 = passphrasechar_1.length;
var len_2 = passphrasechar_2.length;
var len_3 = passphrasechar_3.length;
var len_4 = passphrasechar_4.length;

...

var i_1 = 0; (function i1() {
var i_2 = 0; (function i2() {
var i_3 = 0; (function i3() {
var i_4 = 0; (function i4() {

...

checkphrase =
                        passphrasechar_1[i_1] +
                        passphrasechar_2[i_2] +
                        passphrasechar_3[i_3] +
                        passphrasechar_4[i_4] +

...

There should be some trivial criteria for code quality here.
full member
Activity: 182
Merit: 100
Also, here's an easy way for it to notify you of solution, just put it after bitcoinAddress = ....

Code:
if(bitcoinAddress == checkphrase)
alert(checkphrase);


It found the solution to the previous problem, and actually, it's running quite efficiently going to a combo of 2M, I thought it was laggy, but I had several applications, a game, and browsers open, so that was seemingly causing me the lag. Updating almost at real time now. I'm able to scroll the window and everything Smiley.
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.
legendary
Activity: 1890
Merit: 1086
Ian Knowles - CIYAM Lead Developer
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.

Here is a simple timer example:
Code:
var auto_refresh_seconds = 30;

function auto_refresh( )
{
   if( auto_refresh_seconds == 1 )
      window.location.replace( window.location );
   else if( auto_refresh_seconds > 0 )
   {
      auto_refresh_seconds -= 1;
      setTimeout( "auto_refresh( )", 1000 );
   }
}

function load( )
{
   auto_refresh( );
}
hero member
Activity: 630
Merit: 500
Update 2013-11-30: Bounty claimed. Thanks everyone.


Another day, another lost password.

The code I've pasted below is my (very crude) attempt at modifying bitaddress.org (v 2.4) to help me recover a password in a particular way.

In my particular case, I know the exact length of my password, and pretty much know what every letter is, however I'm stuck on the case of some of the letters.

Example: I don't know if my password is appLe or aPple or ApplE.

In this case, there are 2^X possible combinations, where X is the number of characters whose case I'm unsure of.

If you save the below code as .html and check out the brainwallet tab, you'll see I've modified this page to take each character as a separate input.

Example:

a
p
p
l
e


I've set it up so that for each character, I can type all the different possible combinations for that character, and then the script will check all the possible combinations of the password.

Example, I input:

a
pP
pP
l
e

And it will check:

apple
apPle
aPple
aPPle

What it's checking against, is the 'target' address. I paste in that target address input box the bitcoin address that I'm trying to find the key for. When the script finds a match, it will output the passphrase that resulted in the address, and output the private key for it too.

Now the part I'm stuck on, and what the bounty is for:

Any more than about 20 combinations makes my browser hang, because of the horrible way I've done all this in nested while loops. What I need is for this whole thing to be modified so that the browser doesn't hang, and constantly outputs where it's up to.

Example:
Checking combination 75 out of 8192

I'd like it to kind of act like how the 'bulk wallet' generator tab works, when you generate a huge amount of addresses (say 1000). You can see it working, and doesn't hang the browser.

Code:
http://pastebin.com/ijxcd4qk
(Sorry it was too big to paste here directly)


Edit: Here are the 2 parts I've modified:

My modified 'brainarea' div:
Code:
			



Char 1:

Char 2:

Char 3:

Char 4:

Char 5:

Char 6:

Char 7:

Char 8:

Char 9:

Char 10:

Char 11:

Char 12:

Char 13:

Char 14:

Char 15:

Char 16:

Char 17:

Char 18:

Char 19:

Char 20:

Char 21:

Char 22:

Char 23:

Char 24:

Char 25:

Char 26:

Char 27:

Char 28:

Char 29:

Char 30:

Char 31:

Char 32:

Char 33:

Char 34:

Char 35:

Char 36:

Char 37:

Char 38:

Char 39:

Char 40:

Char 41:

Char 42:

Char 43:

Char 44:

Char 45:

Char 46:

Char 47:

Char 48:



Target Address:





Comma Separated Values: Index,Address,Private Key (WIF)

               




Bitcoin Address:






Private Key (Wallet Import Format):







My modified 'brainwallet' function:
Code:
	
Jump to: