graphenestorage.masterpassword module

class graphenestorage.masterpassword.MasterPassword(config=None, **kwargs)

Bases: object

The keys are encrypted with a Masterpassword that is stored in the configurationStore. It has a checksum to verify correctness of the password The encrypted private keys in keys are encrypted with a random masterkey/masterpassword that is stored in the configuration encrypted by the user-provided password.

Parameters:config (ConfigStore) – Configuration store to get access to the encrypted master password
changePassword(newpassword)

Change the password that allows to decrypt the master key

decrypt(wif)

Decrypt the content according to BIP38

Parameters:wif (str) – Encrypted key
decryptEncryptedMaster()

Decrypt the encrypted masterkey

deriveChecksum(s)

Derive the checksum

Parameters:s (str) – Random string for which to derive the checksum
encrypt(wif)

Encrypt the content according to BIP38

Parameters:wif (str) – Unencrypted key
getEncryptedMaster()

Obtain the encrypted masterkey

Note

The encrypted masterkey is checksummed, so that we can figure out that a provided password is correct or not. The checksum is only 4 bytes long!

has_masterpassword()

Tells us if the config store knows an encrypted masterpassword

lock()

Lock the store so that we can no longer decrypt the content of the store

locked()

Is the store locked. E.g. Is a valid password known that can be used to decrypt the master key?

masterkey

Contains the decrypted master key

newMaster(password)

Generate a new random masterkey, encrypt it with the password and store it in the store.

Parameters:password (str) – Password to use for en-/de-cryption
raiseWrongMasterPasswordException()
saveEncrytpedMaster()
unlock(password)

The password is used to encrypt this masterpassword. To decrypt the keys stored in the keys database, one must use BIP38, decrypt the masterpassword from the configuration store with the user password, and use the decrypted masterpassword to decrypt the BIP38 encrypted private keys from the keys storage!

Parameters:password (str) – Password to use for en-/de-cryption
unlocked()

Is the store unlocked so that I can decrypt the content?