Bitcoin Forum

Bitcoin => Electrum => Topic started by: irukandji on November 01, 2020, 08:45:20 AM



Title: I lost my password to an electrum wallet
Post by: irukandji on November 01, 2020, 08:45:20 AM
Is there any tools to try to find it?
I am pretty sure I know the words I would have used but can't remember the combination of those words.  There are probably not too many possible combinations.


Title: Re: I lost my password to an electrum wallet
Post by: AB de Royse777 on November 01, 2020, 08:59:42 AM
I am not good at maths but perhaps this post may help : https://bitcoin.stackexchange.com/questions/71692/how-many-combinations-are-there-from-the-bip32-mnemonic-list

There are probably not too many possible combinations.
It seems the numbers are too high which is probably is bad news.


Title: Re: I lost my password to an electrum wallet
Post by: Stalker22 on November 01, 2020, 09:25:28 AM
Is there any tools to try to find it?

Let's clarify something first. Did you just forget the electrum password or did you lose the mnemonic seed for your wallet?  If you have a seed, you can restore your wallet from its seed phrase and choose a new password.


Title: Re: I lost my password to an electrum wallet
Post by: BlackHatCoiner on November 01, 2020, 09:28:55 AM
Is there any tools to try to find it?
I am pretty sure I know the words I would have used but can't remember the combination of those words.  There are probably not too many possible combinations.

You have to remember what are the first 3-4 words. Otherwise, you need a really strong machine to print you all those different combinations.

Here I wrote you a javascript code which takes N words and prints all the combinations:
Code:
<script>
var seedArr = [],
  usedChars = [];

function getAllDifferentCombinations(input) {
  var i, ch;
  for (i = 0; i < input.length; i++) {
    ch = input.splice(i, 1)[0];
    usedChars.push(ch);
    if (input.length == 0) {
      seedArr.push(usedChars.slice());
 seedArr.push("</br>")
    }
    getAllDifferentCombinations(input);
    input.splice(i, 0, ch);
    usedChars.pop();
  }
  return seedArr
};

var comb = getAllDifferentCombinations(["word1", "word2", "word3", "word4", "word5", "word6", "word7", "word8", "word9", "word10", "word11", "word12"]).toString();
comb = comb.replaceAll(",", " ");
document.write(comb);
</script>
if you want to run it, create a new test.html file anywhere on your computer and open it with chrome

You can remove words. For example, I ran it with 8 different words. Not more than that, my computer lags. Although, with the above code, you cannot find your lost wallet unless you try all this mess: https://i.imgur.com/yH7xgUq.gif

I need a bitcoin developer to confirm me if there's a way to convert the array of strings, which are the seeds, to private keys and then start checking if there funds on each address.



Title: Re: I lost my password to an electrum wallet
Post by: irukandji on November 01, 2020, 09:31:42 AM
Is there any tools to try to find it?

Let's clarify something first. Did you just forget the electrum password or did you lose the mnemonic seed for your wallet?  If you have a seed, you can restore your wallet from its seed phrase and choose a new password.


I just forgot the password for my wallet.


Title: Re: I lost my password to an electrum wallet
Post by: BlackHatCoiner on November 01, 2020, 09:33:06 AM
I just forgot the password for my wallet. I did not lose the seed
You mean the encrypted password? What's the problem with that if you do have the seed? You haven't lost your funds. The way you describe your problem in the first post is like you've lost the seed.


Title: Re: I lost my password to an electrum wallet
Post by: irukandji on November 01, 2020, 09:34:31 AM
I just forgot the password for my wallet. I did not lose the seed
You mean the encrypted password? What's the problem with that if you do have the seed? You haven't lost your funds.

Ok.. I don't have the seed but may be able to find it.


Title: Re: I lost my password to an electrum wallet
Post by: Stalker22 on November 01, 2020, 09:44:17 AM
Ok.. I don't have the seed but may be able to find it.

I hope you find it. This is your best option for wallet recovery and that is why it is recommended to write it down and keep it in a safe place.


Title: Re: I lost my password to an electrum wallet
Post by: AB de Royse777 on November 01, 2020, 09:49:01 AM
I just forgot the password for my wallet. I did not lose the seed
You mean the encrypted password? What's the problem with that if you do have the seed? You haven't lost your funds.

Ok.. I don't have the seed but may be able to find it.
Now you are confusing everyone.
You do not have 12 word seed or encrypted password. Not having 12 word seed means you are in trouble but not having encrypted password is not a problem at all. Using the 12 word seed, you can restore the wallet very easily.

if you want to run it, create a new test.html file anywhere on your computer and open it with chrome
I tried it using my browser but it was freezing the entire browser then I had to force close it.


Title: Re: I lost my password to an electrum wallet
Post by: BlackHatCoiner on November 01, 2020, 09:51:03 AM
I tried it using my browser but it was freezing the entire browser then I had to force close it.
Reduce the number of words, save and then try again.


Title: Re: I lost my password to an electrum wallet
Post by: AB de Royse777 on November 01, 2020, 09:58:27 AM
I tried it using my browser but it was freezing the entire browser then I had to force close it.
Reduce the number of words, save and then try again.
Yeah, it worked. I tried with 4 words. But it seems this script will not help much unless there can be any automated tool out there. Let's say you have successfully executed the script (after giving it much time and after using a lot of resources) but manually trying each combination is nearly impossible for human.


Title: Re: I lost my password to an electrum wallet
Post by: JeromeTash on November 01, 2020, 10:03:46 AM
You have to remember what are the first 3-4 words. Otherwise, you need a really strong machine to print you all those different combinations.
I am a little confused, did you mean first 3-4 letters instead of words?
Because OP says he probably knows the words he used for the password but does not remember how he ordered them. So he was not talking about the seed phrase but rather the password.


Title: Re: I lost my password to an electrum wallet
Post by: BlackHatCoiner on November 01, 2020, 10:10:20 AM
Yeah, it worked. I tried with 4 words. But it seems this script will not help much unless there can be any automated tool out there. Let's say you have successfully executed the script (after giving it much time and after using a lot of resources) but manually trying each combination is nearly impossible for human.
I'll take it into consideration of developing such application.

I am a little confused, did you mean first 3-4 letters instead of words?
No, I meant words, because I though that seed was what he wanted.


Title: Re: I lost my password to an electrum wallet
Post by: Stalker22 on November 01, 2020, 10:19:04 AM
You have to remember what are the first 3-4 words. Otherwise, you need a really strong machine to print you all those different combinations.
I am a little confused, did you mean first 3-4 letters instead of words?

BlackHatCoiner has posted a script to generate word combinations for a seed phrase. It is not intended for brute force hacking of electrum password.

Speaking of recovering a forgotten password, I found a tool that might be useful to someone in a similar situation.
https://github.com/gurnec/btcrecover

Quote
btcrecover is an open source Bitcoin wallet password and seed recovery tool. It is designed for the case where you already know most of your password or seed, but need assistance in trying different possible combinations.


Title: Re: I lost my password to an electrum wallet
Post by: o_e_l_e_o on November 01, 2020, 10:40:16 AM
Speaking of recovering a forgotten password, I found a tool that might be useful to someone in a similar situation.
https://github.com/gurnec/btcrecover
This is the best answer, but the original version of btcrecover hasn't been updated in 3 years. There is a fork with ongoing active development, wider wallet support, new features, and better optimization, available here: https://github.com/3rdIteration/btcrecover

For recovering a password to wallet file, follow the instructions here: https://github.com/3rdIteration/btcrecover/blob/master/TUTORIAL.md#btcrecover-tutorial

These instructions will talk you through building a tokens.txt file with the words in the password you do remember, any numbers, punctuation, substitutions, typos, etc., which the program will then take, generate all possible combinations, and try them automatically on your wallet file.


Title: Re: I lost my password to an electrum wallet
Post by: khaled0111 on November 01, 2020, 11:07:10 AM
The number of possible combinations depends on the number of words you used to create your password.
If n is the number of words then the number of possible combinations in this case is n! (permutation).

If we are talking about a small number of words, then you can try all possible combinations manually. For 5 words, you would have only 120 possible combination.
For any greater number, you should try the tool suggested above but it needs your wallet file. I hope you still have it.


Title: Re: I lost my password to an electrum wallet
Post by: bitbollo on November 01, 2020, 11:11:11 AM
@OP electrum wallet requires that you write down/ save your wallet seed before any operation.
before trying to guess the password it could be more easy just find the initial seed and restore again the wallet.
if you count also capslock text find your password will be close to impossible ...


Title: Re: I lost my password to an electrum wallet
Post by: irukandji on November 01, 2020, 12:15:29 PM
Thank you for all the replies. I found quite few old seeds, but have not tested them all yet.
Does anyone know if there is another bitcoin wallet that uses the same derivation path as electrum?


Title: Re: I lost my password to an electrum wallet
Post by: khaled0111 on November 01, 2020, 12:35:58 PM
Does anyone know if there is another bitcoin wallet that uses the same derivation path as electrum?
Most wallets use the bip39 standard to generate seeds while Electrum uses its own standard. The only wallet that I am aware of which supports importing Electrum's seeds is bluewallet.
However, you will not be able to import your wallet if it's empty and doesn't have any history.


Title: Re: I lost my password to an electrum wallet
Post by: o_e_l_e_o on November 01, 2020, 01:38:29 PM
Does anyone know if there is another bitcoin wallet that uses the same derivation path as electrum?
Why not just recover the seeds in Electrum itself? If you generated them in Electrum, then the easiest way to restore is going to be in Electrum.

Electrum saves different wallets as different files. One installation of Electrum can support thousands or even millions of different wallets, limited only by free space on your hard disk. When you open Electrum, either hit the button "Create New Wallet", or just enter any unused name in the top field to create a new wallet. Select "Standard Wallet", then "I already have a seed", and try the various seeds you have found.


Title: Re: I lost my password to an electrum wallet
Post by: pooya87 on November 02, 2020, 05:52:31 AM
I need a bitcoin developer to confirm me if there's a way to convert the array of strings, which are the seeds, to private keys and then start checking if there funds on each address.
this is not how brute force supposed to work. you have to think about removing all the bottlenecks and optimizing the algorithm as much as you can instead of adding more bottlenecks. right now your work with "strings" and "printing them" are two huge bottlenecks that slow down anything you want to do.
there is also another step that you are missing which is checking the correctness of the checksum of each seed phrase before moving on to trying to create private keys.


Title: Re: I lost my password to an electrum wallet
Post by: BlackHatCoiner on November 02, 2020, 06:26:08 AM
this is not how brute force supposed to work. you have to think about removing all the bottlenecks and optimizing the algorithm as much as you can instead of adding more bottlenecks. right now your work with "strings" and "printing them" are two huge bottlenecks that slow down anything you want to do.
What do you mean by saying bottlenecks? I don't get it? I can't think of a more productive way to do it. First take all the possible combinations, and then run a program that checks every line.

there is also another step that you are missing which is checking the correctness of the checksum of each seed phrase before moving on to trying to create private keys.
About that, on BIP39 I've noticed that it doesn't matter the checksum. Whatever seed you'll submit on electrum it will take it.


Title: Re: I lost my password to an electrum wallet
Post by: pooya87 on November 02, 2020, 06:36:05 AM
What do you mean by saying bottlenecks? I don't get it? I can't think of a more productive way to do it. First take all the possible combinations, and then run a program that checks every line.
1. you are working with strings, they are inherently slower than integers (or bits to be more exact).
2. that also means you have to keep converting back and forth between strings and bytes when creating checksum while also having to normalize the text with Electrum defined algorithm
3. printing the result whether to UI or to file is also an extremely slow process (that is why your UI hangs when the number of words is higher than 4-5).
4. you don't have to produce ALL possible combinations, it can be reduced by 94% if you validate checksum! (about 6% are correct in BIP39 and i believe it is the close to same value for Electrum).

Quote
About that, on BIP39 I've noticed that it doesn't matter the checksum. Whatever seed you'll submit on electrum it will take it.
it should matter, if your checksum is invalid then this line (https://github.com/spesmilo/electrum/blob/70b03cb92007743ffbe02399284075aa43a77b08/electrum/mnemonic.py#L221) will return false (an invalid seed phrase).
same with BIP39, if your SHA256 checksum is invalid it will be rejected (reference implementation (https://github.com/trezor/python-mnemonic/blob/ad06157e21fc2c2145c726efbfdcf69df1350061/mnemonic/mnemonic.py#L170-L173)).