showToast('Please enter or generate an encryption key','danger');
return;
}
if(key.length!==44){
showToast('Encryption key must be 44 characters (base64 encoded)','danger');
showToast('Encryption key must be 44 characters (URL-safe base64)','danger');
return;
}
constok=awaitshowDangerConfirm('WARNING: Setting or changing the encryption key will affect all encrypted data. Are you sure?','Change Encryption Key');
showToast('Encryption key saved. COPY THE KEY ABOVE before restarting the server!','success');
loadEncryptionKeyStatus();
// Do NOT clear the field — user needs to copy it for backup
}else{
showToast(result.error||'Failed to save encryption key','danger');
}
...
...
@@ -705,6 +732,30 @@ async function saveEncryptionKey() {
}
}
// Reset crypto wallet seeds (delete master keys so they are regenerated with the new encryption key)
asyncfunctionresetCryptoSeeds(){
constok=awaitshowDangerConfirm(
'WARNING: This will delete all crypto master seeds. All existing derived addresses will be lost. Only do this after setting a new encryption key. Are you sure?',