Pages:
Author

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

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.
Pages:
Jump to: