def __init__(self):
     Configuration.__init__(self)
     User_Profile.__init__(self)
     self.PublicIOTA = IOTA_Module(Seed=self.PublicSeed)
     self.PrivateIOTA = IOTA_Module(Seed=self.Private_Seed)
     self.Ledger_Accounts = []
     self.All_Accounts = []
 def PublicBackUp(self):
     Public_Seed = Configuration().PublicSeed
     Private_Seed = User_Profile().Private_Seed
     BackUpAddress = IOTA_Module(Seed=Public_Seed).Generate_Address(Index=2)
     Submit = IOTA_Module(Seed=Private_Seed).Send(
         ReceiverAddress=BackUpAddress, Message=self.Decompose())
     print("Receipt: " + str(Submit))
示例#3
0
def First_Usage():
    if Tools().Check_File(File=str(Configuration().UserFolder + "/" +
                                   Configuration().KeysFolder + "/" +
                                   Configuration().PrivateKey)) == False:
        #First time this program was executed
        while True:
            Password = getpass.getpass(prompt="Enter a password: "******"Enter the passsword again: ")
            if Password == Password2:
                config.Password = Password
                break
            else:
                print("")
                print("Passwords do not match!")
                print("")
        try:
            HayStack().Build_All_Directories()
        except:
            print("No IRI instance running on device.")
    else:
        while True:
            #Turn this on later
            Password = getpass.getpass(prompt="Enter the HayStack password: "******"The password was incorrect. Please try again.")
示例#4
0
 def Build_All_Directories(self):
     Initialization().Build_Application()
     Initialization().InboxGenerator()
     User_Profile()
     Inbox_Manager().Create_DB()
     Contact_Client().Build_ContactDB()
     Trusted_Paths().Build_LedgerDB()
     #Output = Nothing
     return self
 def Decompose(self):
     KeyList = Tools().ReadLine(directory=self.PEMFile)
     KeyString = Tools().List_To_String(List=KeyList)
     KeyEncoded = Tools().String_To_Base64(String=KeyString)
     Private_Seed = User_Profile().Private_Seed
     Combined = str(KeyEncoded + Configuration().Identifier + Private_Seed)
     KeyCipher = Encryption().SymmetricEncryption(
         PlainText=Combined, SecretKey=self.SuperSecretKey1)
     KeyCipher = Encryption().SymmetricEncryption(
         PlainText=KeyCipher, SecretKey=self.SuperSecretKey2)
     return KeyCipher
示例#6
0
 def __init__(self):
     Tools.__init__(self)
     Configuration.__init__(self)
     User_Profile.__init__(self)
     self.Ledger_Accounts_Dir = str(self.UserFolder + "/" +
                                    self.PathFolder + "/" +
                                    self.Ledger_Accounts_File)
     self.Last_Block_Dir = str(self.UserFolder + "/" + self.PathFolder +
                               "/" + self.Last_Block)
     self.Ping_Dir = str(self.UserFolder + "/" + self.PathFolder + "/" +
                         self.Trajectory_Ping)
     self.Incoming_Shrapnells = str(self.UserFolder + "/" +
                                    self.MessageFolder + "/" +
                                    Configuration().ReceivedMessages + "/" +
                                    Configuration().ReceivedMessages +
                                    ".txt")
     self.TrustedNodes_Dir = str(self.UserFolder + "/" + self.PathFolder +
                                 "/" + self.Trusted_Nodes)
     self.Current_Block = Dynamic_Public_Ledger().Calculate_Block().Block
     self.PrivateIOTA = IOTA_Module(Seed=self.Private_Seed)
示例#7
0
def First_Usage():
    if Tools().Check_File(File=str(Configuration().UserFolder + "/" +
                                   Configuration().KeysFolder + "/" +
                                   Configuration().PrivateKey)) == False:

        print("Searching for working IOTA nodes.. please wait 30 seconds...")
        try:
            for i in range(30):
                sleep(1)

            #First time this program was executed
            print("Please enter a password for HayStack.")
            while True:
                Password = getpass.getpass(prompt="Enter a password: "******"Enter the passsword again: ")
                if Password == Password2 != "":
                    config.Password = Password
                    break
                else:
                    print("")
                    print("Passwords do not match!")
                    print("")
        except KeyboardInterrupt:
            Node_Finder.Terminate()
            exit()

        try:
            while True:
                print("Would you like to restore from backup? (y/n)")
                Choice = raw_input(">>> ")
                if Choice == "y":
                    print("Checking connectivity. Please wait.")
                    for i in range(60):
                        sleep(1)
                        Dictionary = HayStack().Fastest_Node()
                        try:
                            x = Dictionary["Receive"]
                            y = Dictionary["Send"]
                            if x != "Error" and y != "Error":
                                break
                        except:
                            pass

                    Recovery = True
                    print(
                        "You have chosen to recover your keys. Please enter your two passwords in the correct order."
                    )
                    print("Type in password 1")
                    SuperSecretKey1 = raw_input(">>> ")
                    print("Type in password 2")
                    SuperSecretKey2 = raw_input(">>> ")

                    print("Password 1: " + SuperSecretKey1 + " Password 2: " +
                          SuperSecretKey2)
                    answer = raw_input("Are these correct? (y/n/b) ")
                    if answer == "y":
                        break
                    elif answer == "b":
                        break
                    elif answer == "n":
                        pass

                elif Choice == "n":
                    Recovery = False
                    break
                else:
                    print("Not a valid choice...")
        except KeyboardInterrupt:
            Node_Finder.Terminate()
            exit()

        if Recovery == True:
            outcome = Restore(SuperSecretKey1,
                              SuperSecretKey2).Restore_FileDirectory()
            if outcome == False:
                print("Failed to restore keys.")
                HayStack().Build_All_Directories()
            else:
                print("Found your house keys!")
        else:
            for i in range(30):
                try:
                    HayStack().Build_All_Directories()
                    break
                except KeyboardInterrupt:
                    Node_Finder.Terminate()
                    exit()
                except:
                    print(
                        "Your connection is unstable. All nodes are now being tested."
                    )
                    Dictionary = HayStack().Fastest_Node()
                    x = Dictionary("Receive")
                    y = Dictionary("Send")
                    if x != "Error" and y != "Error":
                        print("Nodes found!")
    else:
        while True:
            Password = getpass.getpass(prompt="Enter the HayStack password: "******"The password was incorrect. Please try again.")
示例#8
0
	def __init__(self):
		Configuration.__init__(self)
		Encryption.__init__(self)
		User_Profile.__init__(self)
		self.PrivateIOTA = IOTA_Module(Seed = self.Private_Seed)
示例#9
0
	def __init__(self):
		Configuration.__init__(self)
		User_Profile.__init__(self)
		Inbox_Manager.__init__(self)
		self.PrivateIOTA = IOTA_Module(Seed = self.Private_Seed)
		self.Block = Dynamic_Public_Ledger().Calculate_Block().Block