Skip to content

Instantly share code, notes, and snippets.

@SomberNight
Created November 22, 2018 11:43
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save SomberNight/f187aecb4565ead78800c0e0ced3410f to your computer and use it in GitHub Desktop.
Save SomberNight/f187aecb4565ead78800c0e0ced3410f to your computer and use it in GitHub Desktop.
Decrypt Electrum wallet file
import sys
import getpass
from electrum.storage import WalletStorage
##########
# Set the path to your wallet file here.
#
path = "C:/Users/User/AppData/Roaming/Electrum/testnet/wallets/test_segwit_asdasd"
##########
s = WalletStorage(path)
if not s.file_exists():
print("No wallet file at path!")
sys.exit(0)
if not s.is_encrypted():
print("This wallet is not encrypted!")
sys.exit(0)
password = getpass.getpass("Enter your wallet password:", stream=None)
s.decrypt(password)
s.set_password(None)
s.write()
print("Wallet decrypted.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment