Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate combinations using positions #2

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,22 @@ Fire up your console at the project location and execute:
1. Edit the [config.json](./config.json) and paste the `publicAddress` and `encryptedPrivateKey` values of your BIP38 encoded key.
2. Edit the [secrets.js](./secrets.js) so that it will return an array of all secrets you want to test on your BIP38 encoded key.

Example: You can have all combinations for each position. Let say you password could be "SecrEt!insecure" but you don't know each letter that is capitalize. You can set all possibilities for each position:

positions = [
['s', 'S'],
['e', 'E','&'],
['c', 'c'],
['r', 'R'],
['e', 'E'],
['t', 't'],
['1','!',''],
['_','',' '],
['insecure']
];
3 - Edit the [secrets.js] to hide all log secrets combinations. Set logSecrets to false, default is true.


## Start

Fire up your console at the project location and execute:
Expand Down
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"publicAddress": "185Bg57jY8LPC2kDt2HVrSkoKRahxLuUUo",
"encryptedPrivateKey": "6PfSSFMbgEHGCJDsDmkQg8KpUN5ckMK9xXutzR5KujPsvuyZcbzNLXt4Wd"
"publicAddress": "15ay9BXrEeJwKNNL6Lk3yueEX4zfWfpFCN",
"encryptedPrivateKey": "6PnSjKFi1F2xsKpsu9nEhoRk1zFLZPhrKUfNusxCYkLu2QP9QD4ApchbGf"
}
76 changes: 32 additions & 44 deletions secrets.js
Original file line number Diff line number Diff line change
@@ -1,47 +1,35 @@
'use strict';

var combinations = require('./combinations');

module.exports = (function() {

var secrets = [],
prefixedSecrets = [],
suffixedSecrets = [],
paddedSecrets = [],
passwords = [
'insecure',
'secret',
],
letters = ['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'],
numbers = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
dividers = ['|', '&', '+', '-', '_', ' ', ''];


secrets = passwords;

secrets = secrets.concat(combinations(passwords, '!!'));

secrets = secrets.concat(combinations(dividers, passwords[0] + '!' + passwords[1]));
secrets = secrets.concat(combinations(dividers, passwords[1] + '!' + passwords[0]));

secrets.forEach(function(secret) {

prefixedSecrets = prefixedSecrets.concat(combinations(letters, '!!-' + secret));
prefixedSecrets = prefixedSecrets.concat(combinations(numbers, '!' + secret));
prefixedSecrets = prefixedSecrets.concat(combinations(numbers, '!-' + secret));
prefixedSecrets = prefixedSecrets.concat(combinations(numbers, '0!-' + secret));
});

secrets.forEach(function(secret) {

suffixedSecrets = suffixedSecrets.concat(combinations(numbers, secret + '-!'));
suffixedSecrets = suffixedSecrets.concat(combinations(numbers, secret + '-0!'));
});


secrets = secrets.concat(prefixedSecrets);
secrets = secrets.concat(suffixedSecrets);
module.exports = (function () {

var positions = [];
var secrets = [];
var logSecrets = true;

positions = [
['s', 'S'],
['e', 'E','&'],
['c', 'c'],
['r', 'R'],
['e', 'E'],
['t', 't'],
['1','!',''],
['_','',' '],
['insecure']

];

combinations = function (pos, c, soFarSecret) {
if (pos == c.length) {
if(logSecrets)
console.log(soFarSecret);
secrets = secrets.concat(soFarSecret);
return;
}
for (var i = 0; i != c[pos].length; i++) {
combinations(pos + 1, c, soFarSecret + c[pos][i]);
}
}

combinations(0, positions, '', 0);

return secrets;

Expand Down