Bitcoin Forum
May 07, 2024, 12:39:50 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to manually decrypt Electrums encrypted seed and xprv from wallet file  (Read 960 times)
adaseb (OP)
Legendary
*
Offline Offline

Activity: 3752
Merit: 1710



View Profile
May 18, 2017, 06:49:46 AM
 #1

Looking at the wallet file.

If a password is set, how would one be able to decrypt the keystore seed and keystore xprv?

From what I understand you need to convert into base64 first and then decrypt with des3. However doing so it returns a bunch of random ASCII weird characters which aren't the correct seed.

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715042390
Hero Member
*
Offline Offline

Posts: 1715042390

View Profile Personal Message (Offline)

Ignore
1715042390
Reply with quote  #2

1715042390
Report to moderator
btchris
Hero Member
*****
Offline Offline

Activity: 672
Merit: 504

a.k.a. gurnec on GitHub


View Profile WWW
May 29, 2017, 01:09:13 AM
Last edit: May 29, 2017, 01:42:10 PM by btchris
 #2

1. Decode the base-64 into binary.
2. Remove the first 16 bytes, they are the IV. The rest is the cyphertext.
3. Derive the encryption key as sha256(sha256(convert_to_utf8(password))).
4. Decrypt they cyphertext with AES-256 in CBC mode using the key, IV, and cyphertext from above.
5. Remove the trailing PKCS7 padding.

This script will do so for you from a wallet file: https://github.com/gurnec/decrypt_electrum_seed
adaseb (OP)
Legendary
*
Offline Offline

Activity: 3752
Merit: 1710



View Profile
June 02, 2017, 11:23:22 PM
 #3

1. Decode the base-64 into binary.
2. Remove the first 16 bytes, they are the IV. The rest is the cyphertext.
3. Derive the encryption key as sha256(sha256(convert_to_utf8(password))).
4. Decrypt they cyphertext with AES-256 in CBC mode using the key, IV, and cyphertext from above.
5. Remove the trailing PKCS7 padding.

This script will do so for you from a wallet file: https://github.com/gurnec/decrypt_electrum_seed

Hello

Thank you for this

.BEST..CHANGE.███████████████
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
██
███████████████
..BUY/ SELL CRYPTO..
Haigo
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
November 16, 2017, 12:49:40 PM
 #4

I have tried this but receive an error message: KeyError: 'seed'

If anyone can help me decrypt my Electrum 2.7.9 wallet I will be willing to pay a reward.
I do have the original wallet file but unfortunately (and stupidly) do not have seed or password!


Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
November 17, 2017, 04:02:21 AM
 #5

You need the password to decrypt it. If you don't know the exact password but have some idea of what it might be you can attempt to bruteforce it. That means to try various combinations of passwords until you hit the right one. You can bruteforce it using btchris' script given below or hire someone to do it for you:

https://github.com/gurnec/btcrecover

However you must have at least some idea of what the password might be for bruteforcing to be feasible.
immarunner
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
January 05, 2018, 11:32:35 PM
 #6

You need the password to decrypt it. If you don't know the exact password but have some idea of what it might be you can attempt to bruteforce it. That means to try various combinations of passwords until you hit the right one. You can bruteforce it using btchris' script given below or hire someone to do it for you:

https://github.com/gurnec/btcrecover

However you must have at least some idea of what the password might be for bruteforcing to be feasible.


I also attempted to use the decrypt_electrum_seed code from GitHub but kept getting the messages unexpected seed_version: 13 and KeyError : 'seed'.  The same error is produced by wallets that have a password and wallets that don't have a password so do you have any idea what else might be causing these errors?

I think the file mnemonic.py on the decrypt_electrum_seed page possibly contains the words the code uses to try and decrypt the wallet but I could be wrong.  If this is the case then the problem may be in the fact that some of the seed words Electrum generates when new wallets are created are not contained within the mnemonic.py list of words?

But the code might be using a more up to date list than the one shown in mnemonic.py and the problem might be being caused by something else.
Abdussamad
Legendary
*
Offline Offline

Activity: 3612
Merit: 1564



View Profile
January 05, 2018, 11:52:26 PM
 #7

 I'm not the developer. Create an issue on that github repo to get the developer's attention.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!