Skip to content

Commit 2e6d96f

Browse files
author
neocogent
committed
detect and stop on BIP38 EC Multiply variant
1 parent 5363165 commit 2e6d96f

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

scripts/bip38scan

+4
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ if len(sys.argv) < 3:
8686
print "Usage: %s <token file> <BIP38 encoded key>\n" % sys.argv[0]
8787
sys.exit(0)
8888

89+
hexkey = "0"+b58hex(sys.argv[2])
90+
if hexkey[0:2] != '0142':
91+
sys.exit('BIP38 Third-party key (EC Multiply flag) not supported.')
92+
8993
with open(sys.argv[1]) as f:
9094
tokens = f.read()
9195
tokens = tokens.split()

scripts/bip38scanx

+4
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ if __name__ == '__main__':
107107
print "Default depth is 6. ie. scan up to 6 token combinations."
108108
print "Usage: %s <token file> <BIP38 encoded key> [depth]\n" % sys.argv[0]
109109
sys.exit(0)
110+
111+
hexkey = "0"+b58hex(sys.argv[2])
112+
if hexkey[0:2] != '0142':
113+
sys.exit('BIP38 Third-party key (EC Multiply flag) not supported.')
110114

111115
with open(sys.argv[1]) as f:
112116
tokens = f.read()

0 commit comments

Comments
 (0)