Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

Decrypt Lockwise file from json

  • 2 iimpendulo
  • 1 inayo le ngxaki
  • 3 views
  • Impendulo yokugqibela ngu cor-el

more options

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.

All Replies (2)

more options

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

more options

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.


/* 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>");} }