-
-
Save zingi/820946aa03054ae467c16a3ca563e362 to your computer and use it in GitHub Desktop.
Keybase WarpWallet Bounty Challenge
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var attempts = []; | |
var attemptCount = 0; | |
let simultaneousCount = 10; | |
var found = false; | |
function randomString(length, chars) | |
{ | |
var result = ''; | |
for (var i = length; i > 0; --i) result += chars[Math.floor(Math.random() * chars.length)]; | |
return result; | |
} | |
function searchWallet() | |
{ | |
var attempt; | |
var foundNewAttempt = false; | |
while(!foundNewAttempt) | |
{ | |
attempt = randomString(8,'0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
if(attempts.indexOf(attempt) == -1) | |
{ | |
foundNewAttempt = true; | |
attempts.push(attempt); | |
attemptCount++; | |
} | |
} | |
console.log('trying passphrase: ' + attempt + ' (attempt-count: ' + attemptCount + ')'); | |
warpwallet.run({ | |
passphrase: attempt, | |
salt: '[email protected]', | |
progress_hook: (function(_this) | |
{ | |
return function(o) | |
{ | |
return false; | |
}; | |
})(this), | |
params: window.params | |
}, | |
(function(_this) | |
{ | |
return function(res) | |
{ | |
if ( res["public"] == '1MkupVKiCik9iyfnLrJoZLx9RH4rkF3hnA' ) | |
{ | |
console.log('You found it! =D'); | |
console.log(res["public"]); | |
console.log(res["private"]); | |
found = true; | |
} | |
else | |
{ | |
console.log('Out of luck...') | |
if(!found) | |
{ | |
searchWallet(); | |
} | |
} | |
}; | |
})(this)); | |
} | |
for(var i=0; i<simultaneousCount; i++) | |
{ | |
setTimeout(searchWallet, 1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment