("Failed to apply settings:", error);
          alert(`Failed to apply settings: ${error.message}`);
        }
      }

      function getEncryptionKey() {
        const securityKey = document
          .getElementById("security-key")
          .value.trim();
        if (securityKey != window.securityKeyOnDerive) {
          window.encryptionKey = derive_key(securityKey, "example_salt");
          window.securityKeyOnDerive = securityKey;
        }
        return window.encryptionKey;
      }

      async f