
Decrypt Lockwise file from json
I am loving suing Lockwise. Now I found my encrypted password in a json file and want to decrypt it, so I can save it in a readable form, myself as a backup.
I am loving suing Lockwise. Now I found my encrypted password in a json file and want to decrypt it, so I can save it in a readable form, myself as a backup.
所有回复 (2)
Sebastian said
Now I found my encrypted password in a json file and want to decrypt it, so I can save it in a readable form, myself as a backup.
It would be easiest to run code in Firefox's Browser Console to export the contents of the logins.json file. See: https://support.mozilla.org/questions/1271671
You can use the below posted code in the Browser Console to export the logins to a JSON file.
You need to enable the command line in the Browser Console and paste the code in the command line.
- select "Enable browser chrome and add-on debugging toolboxes" in the developer tools settings (Web Console -> F1)
- https://developer.mozilla.org/en-US/Tools/Settings
- https://developer.mozilla.org/en-US/Tools/Browser_Console
/* EXPORT Logins to firefox-logins.json - Firefox 52 and later */ async function exportLogins (aPath, bytes){ await OS.File.writeAtomic(aPath, bytes); } var tokendb = Cc["@mozilla.org/security/pk11tokendb;1"].createInstance(Ci.nsIPK11TokenDB); var token = tokendb.getInternalKeyToken(); try {token.login(true)} catch(e) {Cu.reportError(e)} if (!token.needsLogin() || token.isLoggedIn()) { var logins = Services.logins.getAllLogins({}); var json = JSON.stringify(logins, null, 1); var txt = 'Logins: ' + logins.length; var obj = new Object; obj.value = json; if (Services.prompt.prompt(null, 'Logins - JSON', txt, obj, null, {})) { var fp = Cc["@mozilla.org/filepicker;1"].createInstance(Ci.nsIFilePicker); fp.init(window,"",Ci.nsIFilePicker.modeSave); fp.defaultString = "firefox-logins.json"; fp.open((rv) => { if (rv == Ci.nsIFilePicker.returnOK || rv == Ci.nsIFilePicker.returnReplace) { let bytes = new TextEncoder().encode(json); exportLogins(fp.file.path, bytes); console.log("Saved as:",fp.file.path); }}) } else {console.log("<canceled>");} }