Closed lupettohf closed 8 months ago
Having the same issue. Have not used OpenHaystack before so not sure how to proceed. @MatthewKuKanich if you would be so kind as to add a section to the readme documenting importing into OpenHaystack and adding to the iOS FindMy app I would be really grateful!
Dear @Martyfree123 and @lupettohf , I am happy to assist in questions and make clarification. As you asked,
To import existing .keys to OpenHayStack, you need to firstly generate the .plist file. Try place this script at the root of this project, then use this script to convert the .keys to .plist. The converted .plist can be found under ./keys directory. Modify to match your needs accordingly.
import os, plistlib
if __name__ == "__main__":
keys = []
if not os.path.exists("keys"):
print("No keys found.")
exit(1)
for fname in os.listdir("keys"):
if not fname.endswith(".keys"):
continue
with open(f"keys/{fname}", "rb") as f:
this_key = {}
for line in f.readlines():
line_split = line.decode("utf-8").replace('\n', '').replace(" ", "").split(":")
key, value = line_split[0], line_split[1]
if key == "MAC":
this_key["id"] = int(value, 16)
elif key == "Privatekey":
this_key["privateKey"] = value.encode("utf-8")
this_key["colorComponents"] = [0.0, 0.0, 0.0, 0.0]
this_key["isActive"] = True
this_key["lastDerivationTimestamp"] = 0
this_key["symmetricKey"] = b""
this_key["updateInterval"] = 3600
this_key["icon"] = "briefcase.fill"
this_key["isDeployed"] = True
this_key["colorSpaceName"] = "kCGColorSpaceExtendedSRGB"
this_key["usesDerivation"] = False
this_key["name"] = f"OHS_{hex(this_key['id'])[2:].upper()}"
this_key["oldestRelevantSymmetricKey"] = b""
keys.append(this_key)
with open(f"keys/ohs.plist", "wb") as f:
plistlib.dump(keys, f)
I'm trying to import the generated keys inside OHS however the import function looks for a .plist file; I tried exporting one and it seems holding more keys than the one generated by the python script. Any additional step to perform?