diff --git a/tools/archive.py b/tools/archive.py new file mode 100644 index 0000000..6fe1f4c --- /dev/null +++ b/tools/archive.py @@ -0,0 +1,63 @@ +""" + ARHIVE for FlipypPass + + This will prepare your passwords for Import with FlippyPass + Excuse that this is written in Python... +""" + +# Libraries +import sys +import json + +# Variables +all_passwords = "" + +# Functions +def load_json(): + # Getting file path + file_path = sys.argv[1] + + # Opening file + f_file = open(file_path) + f_data = f_file.read() + + # Parsing json + return json.loads(f_data) +def insert_passwords(json_data): + # Global + global all_passwords + + # Going through items + for item in json_data["items"]: + # Is it not valid? + if not "login" in item: + continue + + # Getting important data from each + name = item["name"] + username = item["login"]["username"] + password = item["login"]["password"] + + # Adding it into our password array + all_passwords += name + "|" + username + "|" + password + "|0|" +def save_data(): + # Global + global all_passwords + + # Opening file + file_data = open('archive.txt', 'w') + file_data.write("Data: " + all_passwords) + file_data.close() + +def main(): + # Loading json + json_data = load_json() + + # Going through all passwords + insert_passwords(json_data) + + # Saving the passwords + save_data() + +# Entry point +main()