Pages:
Author

Topic: [Bounty - 0.5 BTC ($500)] Javascript / Password Recovery issue (CLAIMED) (Read 2625 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
Pages:
Jump to: