mirror of
https://github.com/status-im/infra-utils.git
synced 2025-02-23 17:38:12 +00:00
https://ethereum.stackexchange.com/questions/12830/how-to-get-private-key-from-account-address-and-password Signed-off-by: Jakub Sokołowski <jakub@status.im>
14 lines
348 B
Python
Executable File
14 lines
348 B
Python
Executable File
#!/usr/bin/env python3
|
|
import sys
|
|
import binascii
|
|
from web3.auto import w3
|
|
|
|
keystore_password = sys.argv[1]
|
|
keystore_file_path = sys.argv[2]
|
|
|
|
with open(keystore_file_path) as keyfile:
|
|
encrypted_key = keyfile.read()
|
|
private_key = w3.eth.account.decrypt(encrypted_key, keystore_password)
|
|
|
|
print(binascii.b2a_hex(private_key).decode('utf-8'))
|