diff --git a/dist/index.html b/dist/index.html
index 641a962..baed6a5 100644
--- a/dist/index.html
+++ b/dist/index.html
@@ -5,9 +5,9 @@
e.stopPropagation()}>
Export Vault
-
All entries and groups will be exported as encrypted JSON. You'll need your master password to import them later.
+
All entries and groups will be exported. You'll need the source vault's master password when importing into another vault.
+ {:else if parsedFileData}
+
File loaded. Enter the source vault's master password to decrypt and re-encrypt entries under your current vault.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
{:else}
Select how to handle existing data:
@@ -127,7 +181,7 @@
id="import-file"
type="file"
accept=".json,application/json"
- onchange={handleImport}
+ onchange={handleFileSelect}
disabled={importing}
/>
@@ -246,4 +300,24 @@
font-size: 0.85rem;
padding: 8px;
}
+
+ .form-group {
+ margin-bottom: 16px;
+ }
+
+ .form-group input[type="password"] {
+ width: 100%;
+ padding: 8px 12px;
+ font-size: 0.85rem;
+ border: 1px solid var(--color-border);
+ border-radius: var(--radius-md);
+ background: var(--color-surface);
+ color: var(--color-text);
+ box-sizing: border-box;
+ }
+
+ .form-group input[type="password"]:focus {
+ outline: none;
+ border-color: var(--color-primary);
+ }
diff --git a/src/lib/storage/db.js b/src/lib/storage/db.js
index b3f3cea..599b2f4 100644
--- a/src/lib/storage/db.js
+++ b/src/lib/storage/db.js
@@ -12,6 +12,7 @@
*/
import { openDB } from 'idb'
+import { deriveKey, decrypt, encrypt } from '../crypto/crypto.js'
const DB_NAME = 'password-vault'
const DB_VERSION = 1
@@ -281,7 +282,9 @@ export async function getEntryCountsByGroup() {
/**
* Export all data (entries + groups + meta) as a JSON object.
- * Entries remain encrypted â the importer needs the same master password.
+ * Entries remain encrypted with the source vault's key. The import function
+ * requires the source vault's master password to decrypt and re-encrypt
+ * entries under the target vault's key.
*
* @returns {Promise