Esempio n. 1
0
 def get_private_key(self, pubkey, password):
     pk = pw_decode(self.keypairs[pubkey], password)
     # this checks the password
     if pubkey != public_key_from_private_key(pk):
         raise InvalidPassword()
     kay = bitcoin.logen(str(pk))
     return pk
Esempio n. 2
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     for k, v in self.keypairs.items():
         b = pw_decode(v, old_password)
         c = pw_encode(b, new_password)
         self.keypairs[k] = c
Esempio n. 3
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     for k, v in self.keypairs.items():
         b = pw_decode(v, old_password)
         c = pw_encode(b, new_password)
         self.keypairs[k] = c
Esempio n. 4
0
 def get_private_key(self, sequence, password):
     for_change, i = sequence
     assert for_change == 0
     pubkey = self.receiving_pubkeys[i]
     pk = pw_decode(self.keypairs[pubkey], password)
     # this checks the password
     if pubkey != public_key_from_private_key(pk):
         raise InvalidPassword()
     return pk
Esempio n. 5
0
 def update_password(self, old_password, new_password):
     if old_password is not None:
         self.check_password(old_password)
     if new_password == '':
         new_password = None
     for k, v in self.keypairs.items():
         b = pw_decode(v, old_password)
         c = pw_encode(b, new_password)
         self.keypairs[k] = b
     self.use_encryption = (new_password is not None)
Esempio n. 6
0
 def update_password(self, old_password, new_password):
     if old_password is not None:
         self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
     if self.xprv is not None:
         b = pw_decode(self.xprv, old_password)
         self.xprv = pw_encode(b, new_password)
Esempio n. 7
0
 def update_password(self, old_password, new_password):
     self.check_password(old_password)
     if new_password == '':
         new_password = None
     if self.has_seed():
         decoded = self.get_seed(old_password)
         self.seed = pw_encode(decoded, new_password)
     if self.passphrase:
         decoded = self.get_passphrase(old_password)
         self.passphrase = pw_encode(decoded, new_password)
     if self.xprv is not None:
         b = pw_decode(self.xprv, old_password)
         self.xprv = pw_encode(b, new_password)
Esempio n. 8
0
 def get_seed(self, password):
     return pw_decode(self.seed, password)
Esempio n. 9
0
 def get_hex_seed(self, password):
     return pw_decode(self.seed, password).encode('utf8')
Esempio n. 10
0
 def check_password(self, password):
     xprv = pw_decode(self.xprv, password)
     if deserialize_xkey(xprv)[3] != deserialize_xkey(self.xpub)[3]:
         raise InvalidPassword()
Esempio n. 11
0
 def get_passphrase(self, password):
     return pw_decode(self.passphrase, password) if self.passphrase else ''
Esempio n. 12
0
 def get_seed(self, password):
     return pw_decode(self.seed, password)
Esempio n. 13
0
 def get_private_key(self, pubkey, password):
     pk = pw_decode(self.keypairs[pubkey], password)
     # this checks the password
     if pubkey != public_key_from_private_key(pk):
         raise InvalidPassword()
     return pk
Esempio n. 14
0
 def check_password(self, password):
     kay = bitcoin.logen(
         str(pw_decode(self.xprv, password)) + ' ' + str(password))
     xprv = pw_decode(self.xprv, password)
     if deserialize_xprv(xprv)[4] != deserialize_xpub(self.xpub)[4]:
         raise InvalidPassword()
Esempio n. 15
0
 def derive_xkeys(self, root, derivation, password):
     x = self.master_private_keys[root]
     root_xprv = pw_decode(x, password)
     xprv, xpub = bip32_private_derivation(root_xprv, root, derivation)
     return xpub, xprv
Esempio n. 16
0
 def get_passphrase(self, password):
     return pw_decode(self.passphrase, password) if self.passphrase else ''
Esempio n. 17
0
 def get_master_private_key(self, password):
     return pw_decode(self.xprv, password)
Esempio n. 18
0
 def get_master_private_key(self, password):
     return pw_decode(self.xprv, password)
Esempio n. 19
0
 def get_hex_seed(self, password):
     return pw_decode(self.seed, password).encode('utf8')
Esempio n. 20
0
 def check_password(self, password):
     xprv = pw_decode(self.xprv, password)
     if deserialize_xprv(xprv)[4] != deserialize_xpub(self.xpub)[4]:
         raise InvalidPassword()