Open demonluca opened 11 months ago
Typically, in order for this attack to be feasible, an attacker would need something which was generated from Math.random() at the time of wallet generation -- this would typically be the wallet GUID or IV. This reduces the amount of necessary work anywhere from 32 to 64-bits
This program is designed to replicate the way exchanges such as BitGo, Block.io, BitPay, etc. generated private keys / addresses using the SecureRandom() function in BitcoinJS. I would be happy to discuss other ways to implement this if you have any ideas.
bitcoin.js archive from rushwallett.....they ran a contest with brain wallets, 28 are listed as found with the private key and address. Using those and this code possibly can figure out a starting seed? var WB$wombat$assign$function = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; }; if (!self.WB_pmw) { self.__WB_pmw = function(obj) { this.WB_source = obj; return this; } } { let window = WB$wombat$assign$function("window"); let self = WB$wombat$assign$function("self"); let document = WB$wombat$assign$function("document"); let location = WB$wombat$assign$function("location"); let top = WB$wombat$assign$function("top"); let parent = WB$wombat$assign$function("parent"); let frames = WB$wombat$assign$function("frames"); let opener = WB$wombat$assign$function("opener");
!function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.Bitcoin=e():"undefined"!=typeof global?global.Bitcoin=e():"undefined"!=typeof self&&(self.Bitcoin=e())}(function(){var define,module,exports;return function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}({1:[function(require,module,exports){var base58=require("./base58");var Crypto=require("./crypto-js/crypto");var conv=require("./convert");var util=require("./util");var address_types={prod:0,testnet:111};var p2sh_types={prod:5,testnet:196};var Address=function(bytes,version){if(arguments[0]instanceof Address){this.hash=arguments[0].hash;this.version=arguments[0].version}else if(typeof bytes==="string"){this.hash=bytes.length<=34?base58.checkDecode(bytes):bytes.length<=40?conv.hexToBytes(bytes):util.error("Bad input");this.version=version||this.hash.version||0}else{this.hash=bytes;this.version=version||0}};Address.prototype.toString=function(){return base58.checkEncode(this.hash.slice(0),this.version)};Address.prototype.getHash=function(){return conv.bytesToHex(this.hash)};Address.getVersion=function(string){return base58.decode(string)[0]};Address.validate=function(string){try{base58.checkDecode(string);return true}catch(e){return false}};Address.decodeString=function(string){return base58.checkDecode(string)};module.exports=Address},{"./base58":2,"./convert":4,"./crypto-js/crypto":5,"./util":22}],2:[function(require,module,exports){var BigInteger=require("./jsbn/jsbn");var Crypto=require("./crypto-js/crypto");var conv=require("./convert");var alphabet="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";var base=BigInteger.valueOf(58);var positions={};for(var i=0;i<alphabet.length;++i){positions[alphabet[i]]=i}module.exports.encode=function(input){var bi=BigInteger.fromByteArrayUnsigned(input);var chars=[];while(bi.compareTo(base)>=0){var mod=bi.mod(base);chars.push(alphabet[mod.intValue()]);bi=bi.subtract(mod).divide(base)}chars.push(alphabet[bi.intValue()]);for(var i=0;i<input.length;i++){if(input[i]==0){chars.push(alphabet[0])}else break}return chars.reverse().join("")},module.exports.encodeHex=function(input){return conv.bytesToHex(module.exports.encode(input))};module.exports.decode=function(input){var base=BigInteger.valueOf(58);var length=input.length;var num=BigInteger.valueOf(0);var leading_zero=0;var seen_other=false;for(var i=0;i<length;++i){var chr=input[i];var p=positions[chr];if(p===undefined){throw new Error("invalid base58 string: "+input)}num=num.multiply(base).add(BigInteger.valueOf(p));if(chr=="1"&&!seen_other){++leading_zero}else{seen_other=true}}var bytes=num.toByteArrayUnsigned();while(leading_zero-->0){bytes.unshift(0)}return bytes};module.exports.decodeHex=function(input){return module.exports.decode(conv.hexToBytes(input))};module.exports.checkEncode=function(input,vbyte){vbyte=vbyte||0;var front=[vbyte].concat(input);var checksum=Crypto.SHA256(Crypto.SHA256(front,{asBytes:true}),{asBytes:true}).slice(0,4);return module.exports.encode(front.concat(checksum))};module.exports.checkEncodeHex=function(input,vbyte){return conv.bytesToHex(module.exports.encode(input))};module.exports.checkDecode=function(input){var bytes=module.exports.decode(input),front=bytes.slice(0,bytes.length-4),back=bytes.slice(bytes.length-4);var checksum=Crypto.SHA256(Crypto.SHA256(front,{asBytes:true}),{asBytes:true}).slice(0,4);if(""+checksum!=""+back){throw new Error("Checksum failed")}var o=front.slice(1);o.version=front[0];return o};module.exports.checkDecodeHex=function(input){return module.exports.checkDecode(conv.hexToBytes(input))}},{"./convert":4,"./crypto-js/crypto":5,"./jsbn/jsbn":14}],3:[function(require,module,exports){var Script=require("./script"),util=require("./util"),conv=require("./convert"),key=require("./eckey"),base58=require("./base58"),Crypto=require("./crypto-js/crypto"),ECPointFp=require("./jsbn/ec").ECPointFp,sec=require("./jsbn/sec"),ecparams=sec("secp256k1");var BIP32key=function(opts){if(!opts)opts={};if(typeof opts=="string"){try{opts=BIP32key.prototype.deserialize(opts)}catch(e){opts=BIP32key.prototype.fromMasterKey(opts)}}this.vbytes=opts.vbytes;this.depth=opts.depth;this.fingerprint=opts.fingerprint;this.i=opts.i;this.chaincode=opts.chaincode;this.key=opts.key;this.type=conv.bytesToString(this.vbytes)==PRIVDERIV?"priv":"pub";return this};var PRIVDERIV=BIP32key.PRIVDERIV="ˆÂä";var PUBDERIV=BIP32key.PUBDERIV="ˆ²";BIP32key.prototype.deserialize=function(str){var bytes=base58.decode(str);var front=bytes.slice(0,bytes.length-4),back=bytes.slice(bytes.length-4);var checksum=Crypto.SHA256(Crypto.SHA256(front,{asBytes:true}),{asBytes:true}).slice(0,4);if(""+checksum!=""+back){throw new Error("Checksum failed")}var type=conv.bytesToString(bytes.slice(0,4))==PRIVDERIV?"priv":"pub";return new BIP32key({type:type,vbytes:bytes.slice(0,4),depth:bytes[4],fingerprint:bytes.slice(5,9),i:util.bytesToNum(bytes.slice(9,13).reverse()),chaincode:bytes.slice(13,45),key:new key(type=="priv"?bytes.slice(46,78).concat([1]):bytes.slice(45,78))})};BIP32key.prototype.serialize=function(){var bytes=this.vbytes.concat([this.depth],this.fingerprint,util.numToBytes(this.i,4).reverse(),this.chaincode,this.type=="priv"?[0].concat(this.key.export("bytes").slice(0,32)):this.key);var checksum=Crypto.SHA256(Crypto.SHA256(bytes,{asBytes:true}),{asBytes:true}).slice(0,4);return base58.encode(bytes.concat(checksum))};BIP32key.prototype.ckd=function(i){var priv,pub,newkey,fingerprint,blob,I;if(this.type=="priv"){priv=this.key.export("bytes");pub=this.key.getPub()}else pub=this.key;if(i>=2147483648){if(this.priv)throw new Error("Can't do private derivation on public key!");blob=[0].concat(priv.slice(0,32),util.numToBytes(i,4).reverse())}else blob=pub.concat(util.numToBytes(i,4).reverse());I=Crypto.HMAC(Crypto.SHA512,blob,this.chaincode,{asBytes:true});if(this.type=="priv"){Ikey=Bitcoin.BigInteger.fromByteArrayUnsigned(I.slice(0,32));newkey=new key(this.key.priv.add(Ikey));newkey.compressed=true;fingerprint=util.sha256ripe160(this.key.getPub()).slice(0,4)}else{newkey=ECPointFp.decodeFrom(ecparams.getCurve(),this.key).add(new key(I.slice(0,32).concat([1])).getPubPoint()).getEncoded(true);fingerprint=util.sha256ripe160(this.key).slice(0,4)}return new BIP32key({vbytes:this.vbytes,type:this.type,depth:this.depth+1,fingerprint:fingerprint,i:i,chaincode:I.slice(32),key:newkey})};BIP32key.prototype.clone=function(){return new BIP32key(this)};BIP32key.prototype.privtopub=BIP32key.prototype.getPub=function(){if(this.type=="pub")return this.clone();return new BIP32key({vbytes:conv.stringToBytes(PUBDERIV),type:"pub",depth:this.depth,fingerprint:this.fingerprint,i:this.i,chaincode:this.chaincode,key:this.key.getPub()})};BIP32key.prototype.fromMasterKey=function(seed){var I=Bitcoin.Crypto.HMAC(Bitcoin.Crypto.SHA512,seed,"Bitcoin seed",{asBytes:true});return new BIP32key({vbytes:conv.stringToBytes(PRIVDERIV),type:"priv",depth:0,fingerprint:[0,0,0,0],i:0,chaincode:I.slice(32),key:new key(I.slice(0,32).concat([1]))})};BIP32key.prototype.getKey=function(){return this.key};module.exports=BIP32key},{"./base58":2,"./convert":4,"./crypto-js/crypto":5,"./eckey":11,"./jsbn/ec":13,"./jsbn/sec":17,"./script":20,"./util":22}],4:[function(require,module,exports){var base64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";String.prototype.lpad=function(padString,length){var str=this;while(str.length<length)str=padString+str;return str};module.exports.bytesToHex=function(bytes){return bytes.map(function(x){return x.toString(16).lpad("0",2)}).join("")};module.exports.hexToBytes=function(hex){return hex.match(/../g).map(function(x){return parseInt(x,16)})};module.exports.bytesToBase64=function(bytes){for(var base64=[],i=0;i<bytes.length;i+=3){var triplet=bytes[i]<<16|bytes[i+1]<<8|bytes[i+2];for(var j=0;j<4;j++){if(i8+j6<=bytes.length8)base64.push(base64map.charAt(triplet>>>6(3-j)&63));else base64.push("=")}}return base64.join("")};module.exports.base64ToBytes=function(base64){base64=base64.replace(/[^A-Z0-9+\/]/gi,"");for(var bytes=[],i=0,imod4=0;i<base64.length;imod4=++i%4){if(imod4==0)continue;bytes.push((base64map.indexOf(base64.charAt(i-1))&Math.pow(2,-2imod4+8)-1)<<imod42|base64map.indexOf(base64.charAt(i))>>>6-imod42)}return bytes};module.exports.coerceToBytes=function(input){if(typeof input=="string")return module.exports.hexToBytes(input);return input};module.exports.binToBytes=function(bin){return bin.match(/......../g).map(function(x){return parseInt(x,2)})};module.exports.bytesToBin=function(bytes){return bytes.map(function(x){return x.toString(2).lpad("0",8)}).join("")};module.exports.bytesToString=function(bytes){return bytes.map(function(x){return String.fromCharCode(x)}).join("")};module.exports.stringToBytes=function(string){return string.split("").map(function(x){return x.charCodeAt(0)})}},{}],5:[function(require,module,exports){var Crypto=module.exports={};var util=Crypto.util={randomBytes:function(n){for(var bytes=[];n>0;n--)bytes.push(Math.floor(Math.random()256));return bytes}};Crypto.mode={};var charenc=Crypto.charenc={};var UTF8=charenc.UTF8={stringToBytes:function(str){return Binary.stringToBytes(unescape(encodeURIComponent(str)))},bytesToString:function(bytes){return decodeURIComponent(escape(Binary.bytesToString(bytes)))}};var Binary=charenc.Binary={stringToBytes:function(str){for(var bytes=[],i=0;i<str.length;i++)bytes.push(str.charCodeAt(i));return bytes},bytesToString:function(bytes){for(var str=[],i=0;i<bytes.length;i++)str.push(String.fromCharCode(bytes[i]));return str.join("")}};module.exports.SHA256=require("./sha256");module.exports.SHA512=require("./sha512");module.exports.RIPEMD160=require("./ripemd160");module.exports.HMAC=require("./hmac")},{"./hmac":6,"./ripemd160":7,"./sha256":8,"./sha512":9}],6:[function(require,module,exports){var conv=require("../convert"),util=require("../util");module.exports=function(hasher,message,key,options){if(message.constructor==String)message=conv.stringToBytes(message);if(key.constructor==String)key=conv.stringToBytes(key);if(key.length>hasher._blocksize)key=hasher(key,{asBytes:true});var okey=key.slice(0),ikey=key.slice(0);for(var i=0;i<hasher._blocksize;i++){okey[i]^=92;ikey[i]^=54}var hmacbytes=hasher(okey.concat(hasher(ikey.concat(message),{asBytes:true})),{asBytes:true});return options&&options.asBytes?hmacbytes:options&&options.asString?conv.bytesToString(hmacbytes):conv.bytesToHex(hmacbytes)}},{"../convert":4,"../util":22}],7:[function(require,module,exports){var conv=require("../convert");var UTF8=require("./crypto").charenc.UTF8;var zl=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13];var zr=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11];var sl=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6];var sr=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11];var hl=[0,1518500249,1859775393,2400959708,2840853838];var hr=[1352829926,1548603684,1836072691,2053994217,0];var bytesToWords=function(bytes){var words=[];for(var i=0,b=0;i<bytes.length;i++,b+=8){words[b>>>5]|=bytes[i]<<24-b%32}return words};var wordsToBytes=function(words){var bytes=[];for(var b=0;b<words.length32;b+=8){bytes.push(words[b>>>5]>>>24-b%32&255)}return bytes};var processBlock=function(H,M,offset){for(var i=0;i<16;i++){var offset_i=offset+i;var M_offset_i=M[offset_i];M[offset_i]=(M_offset_i<<8|M_offset_i>>>24)&16711935|(M_offset_i<<24|M_offset_i>>>8)&4278255360}var al,bl,cl,dl,el;var ar,br,cr,dr,er;ar=al=H[0];br=bl=H[1];cr=cl=H[2];dr=dl=H[3];er=el=H[4];var t;for(var i=0;i<80;i+=1){t=al+M[offset+zl[i]]|0;if(i<16){t+=f1(bl,cl,dl)+hl[0]}else if(i<32){t+=f2(bl,cl,dl)+hl[1]}else if(i<48){t+=f3(bl,cl,dl)+hl[2]}else if(i<64){t+=f4(bl,cl,dl)+hl[3]}else{t+=f5(bl,cl,dl)+hl[4]}t=t|0;t=rotl(t,sl[i]);t=t+el|0;al=el;el=dl;dl=rotl(cl,10);cl=bl;bl=t;t=ar+M[offset+zr[i]]|0;if(i<16){t+=f5(br,cr,dr)+hr[0]}else if(i<32){t+=f4(br,cr,dr)+hr[1]}else if(i<48){t+=f3(br,cr,dr)+hr[2]}else if(i<64){t+=f2(br,cr,dr)+hr[3]}else{t+=f1(br,cr,dr)+hr[4]}t=t|0;t=rotl(t,sr[i]);t=t+er|0;ar=er;er=dr;dr=rotl(cr,10);cr=br;br=t}t=H[1]+cl+dr|0;H[1]=H[2]+dl+er|0;H[2]=H[3]+el+ar|0;H[3]=H[4]+al+br|0;H[4]=H[0]+bl+cr|0;H[0]=t};function f1(x,y,z){return x^y^z}function f2(x,y,z){return x&y|~x&z}function f3(x,y,z){return(x|~y)^z}function f4(x,y,z){return x&z|y&~z}function f5(x,y,z){return x^(y|~z)}function rotl(x,n){return x<<n|x>>>32-n}module.exports=function(message,options){if(message.constructor===String){message=UTF8.stringToBytes(message)}var H=[1732584193,4023233417,2562383102,271733878,3285377520];var m=bytesToWords(message);var nBitsLeft=message.length8;var nBitsTotal=message.length8;m[nBitsLeft>>>5]|=128<<24-nBitsLeft%32;m[(nBitsLeft+64>>>9<<4)+14]=(nBitsTotal<<8|nBitsTotal>>>24)&16711935|(nBitsTotal<<24|nBitsTotal>>>8)&4278255360;for(var i=0;i<m.length;i+=16){processBlock(H,m,i)}for(var i=0;i<5;i++){var H_i=H[i];H[i]=(H_i<<8|H_i>>>24)&16711935|(H_i<<24|H_i>>>8)&4278255360}var digestbytes=wordsToBytes(H);return options&&options.asBytes?digestbytes:options&&options.asString?Binary.bytesToString(digestbytes):conv.bytesToHex(digestbytes)}},{"../convert":4,"./crypto":5}],8:[function(require,module,exports){var conv=require("../convert"),util=require("../util");var K=[];(function(){function isPrime(n){var sqrtN=Math.sqrt(n);for(var factor=2;factor<=sqrtN;factor++){if(!(n%factor)){return false}}return true}function getFractionalBits(n){return(n-(n|0))4294967296|0}var n=2;var nPrime=0;while(nPrime<64){if(isPrime(n)){K[nPrime]=getFractionalBits(Math.pow(n,1/3));nPrime++}n++}})();var W=[];var processBlock=function(H,M,offset){var a=H[0];var b=H[1];var c=H[2];var d=H[3];var e=H[4];var f=H[5];var g=H[6];var h=H[7];for(var i=0;i<64;i++){if(i<16){W[i]=M[offset+i]|0}else{var gamma0x=W[i-15];var gamma0=(gamma0x<<25|gamma0x>>>7)^(gamma0x<<14|gamma0x>>>18)^gamma0x>>>3;var gamma1x=W[i-2];var gamma1=(gamma1x<<15|gamma1x>>>17)^(gamma1x<<13|gamma1x>>>19)^gamma1x>>>10;W[i]=gamma0+W[i-7]+gamma1+W[i-16]}var ch=e&f^~e&g;var maj=a&b^a&c^b&c;var sigma0=(a<<30|a>>>2)^(a<<19|a>>>13)^(a<<10|a>>>22);var sigma1=(e<<26|e>>>6)^(e<<21|e>>>11)^(e<<7|e>>>25);var t1=h+sigma1+ch+K[i]+W[i];var t2=sigma0+maj;h=g;g=f;f=e;e=d+t1|0;d=c;c=b;b=a;a=t1+t2|0}H[0]=H[0]+a|0;H[1]=H[1]+b|0;H[2]=H[2]+c|0;H[3]=H[3]+d|0;H[4]=H[4]+e|0;H[5]=H[5]+f|0;H[6]=H[6]+g|0;H[7]=H[7]+h|0};module.exports=function(message,options){var H=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];if(message.constructor===String){message=conv.stringToBytes(message)}var m=util.bytesToWords(message);var l=message.length8;m[l>>5]|=128<<24-l%32;m[(l+64>>9<<4)+15]=l;for(var i=0;i<m.length;i+=16){processBlock(H,m,i)}var digestbytes=util.wordsToBytes(H);return options&&options.asBytes?digestbytes:options&&options.asString?Binary.bytesToString(digestbytes):conv.bytesToHex(digestbytes)};module.exports._blocksize=64},{"../convert":4,"../util":22}],9:[function(require,module,exports){var conv=require("../convert");var util=require("../util");var K=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]];var W=[];for(var i=0;i<80;i++)W.push([0,0]);var processBlock=function(H,M,offset){var H0=H[0];var H1=H[1];var H2=H[2];var H3=H[3];var H4=H[4];var H5=H[5];var H6=H[6];var H7=H[7];var H0h=H0[0];var H0l=H0[1];var H1h=H1[0];var H1l=H1[1];var H2h=H2[0];var H2l=H2[1];var H3h=H3[0];var H3l=H3[1];var H4h=H4[0];var H4l=H4[1];var H5h=H5[0];var H5l=H5[1];var H6h=H6[0];var H6l=H6[1];var H7h=H7[0];var H7l=H7[1];var ah=H0h;var al=H0l;var bh=H1h;var bl=H1l;var ch=H2h;var cl=H2l;var dh=H3h;var dl=H3l;var eh=H4h;var el=H4l;var fh=H5h;var fl=H5l;var gh=H6h;var gl=H6l;var hh=H7h;var hl=H7l;for(var i=0;i<80;i++){var Wi=W[i];if(i<16){var Wih=Wi[0]=M[offset+i2]|0;var Wil=Wi[1]=M[offset+i2+1]|0}else{var gamma0x=W[i-15];var gamma0xh=gamma0x[0];var gamma0xl=gamma0x[1];var gamma0h=(gamma0xh>>>1|gamma0xl<<31)^(gamma0xh>>>8|gamma0xl<<24)^gamma0xh>>>7;var gamma0l=(gamma0xl>>>1|gamma0xh<<31)^(gamma0xl>>>8|gamma0xh<<24)^(gamma0xl>>>7|gamma0xh<<25);var gamma1x=W[i-2];var gamma1xh=gamma1x[0];var gamma1xl=gamma1x[1];var gamma1h=(gamma1xh>>>19|gamma1xl<<13)^(gamma1xh<<3|gamma1xl>>>29)^gamma1xh>>>6;var gamma1l=(gamma1xl>>>19|gamma1xh<<13)^(gamma1xl<<3|gamma1xh>>>29)^(gamma1xl>>>6|gamma1xh<<26);var Wi7=W[i-7];var Wi7h=Wi7[0];var Wi7l=Wi7[1];var Wi16=W[i-16];var Wi16h=Wi16[0];var Wi16l=Wi16[1];var Wil=gamma0l+Wi7l;var Wih=gamma0h+Wi7h+(Wil>>>0>>0?1:0)|0;dh=ch;dl=cl;ch=bh;cl=bl;bh=ah;bl=al;al=t1l+t2l|0;ah=t1h+t2h+(al>>>0
>>0?1:0);H4l=H4[1]=H4l+el;H4[0]=H4h+eh+(H4l>>>0
} /* FILE ARCHIVED ON 17:44:51 Feb 08, 2015 AND RETRIEVED FROM THE INTERNET ARCHIVE ON 04:42:46 Dec 16, 2023. JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
/ / playback timings (ms): captures_list: 93.39 exclusion.robots: 0.393 exclusion.robots.policy: 0.372 cdx.remote: 0.142 esindex: 0.019 LoadShardBlock: 47.992 (3) PetaboxLoader3.datanode: 50.858 (4) load_resource: 51.173 PetaboxLoader3.resolve: 25.638 */ Copilotly
bitcoin.js archive from rushwallett.....they ran a contest with brain wallets, 28 are listed as found with the private key and address. Using those and this code possibly can figure out a starting seed?
Probably not...
This program is designed to replicate the way exchanges such as BitGo, Block.io, BitPay, etc. generated private keys / addresses using the SecureRandom() function in BitcoinJS. I would be happy to discuss other ways to implement this if you have any ideas.
Wonder if there’s a way to generate the keys given a set GUID range first, and maybe generate keys sequentially or in a bit range
This program is designed to replicate the way exchanges such as BitGo, Block.io, BitPay, etc. generated private keys / addresses using the SecureRandom() function in BitcoinJS. I would be happy to discuss other ways to implement this if you have any ideas.
Wonder if there’s a way to generate the keys given a set GUID range first, and maybe generate keys sequentially or in a bit range
I don't think it would make a difference because the SecureRandom() function uses rng_seed_time(). Which means the seed for the random number generator is being derived from the current time.
The problem comes from finding the seed that was used for Math.random If we can replicate the exact seed and process that were used then we don't need to check the range we just use the exact key to create seeds/addresses and check for balance
Yes, if you know the seed used to initialize the random number generator, and have access to the algorithm used, then you can reproduce the entire sequence of random numbers. All you would need to do is process 2^32 keys if you knew the seed, which is ~ 2 billion keys.
how does the profanity exploit work? I think there's like 4 billion for that and somehow it was able to be exploited. maybe a similar method can be used if your targeting a specific address?
how does the profanity exploit work? I think there's like 4 billion for that and somehow it was able to be exploited. maybe a similar method can be used if your targeting a specific address?
Maybe something like creating tables as a base and searching that way? Not sure how these things work regarding resources cpu/gpu/ram etc there so many methods out there
Randstorm vulnerability is not about generating the wallets but about generating the next values of wallets which belong to each others keys and knowing the private keys they use