code: def OnCreateAccount(self, account):
          
          pubkey = account.PublicKey.encode_point(False)
          pubkeyunhex = binascii.unhexlify(pubkey)
          pub = pubkeyunhex[1:65]
  
          priv = bytearray(account.PrivateKey)
          decrypted = pub + priv
          encrypted_pk = self.EncryptPrivateKey(bytes(decrypted))
  
          db_account, created = Account.get_or_create(
              PrivateKeyEncrypted=encrypted_pk, PublicKeyHash=account.PublicKeyHash.ToBytes())
          db_account.save()
          self.__dbaccount = db_account
docs: Save a KeyPair in encrypted form into the database.
  
          Args:
              account (KeyPair):