1# PCH-02-005 — Document the legacy PBKDF2 import KDF + recommend re-export23**Severity:** Informational4**Target files:** `src/shared/backup.ts:146` (`derivePeachExportKey`),5`src/popup/views/Import.tsx` (re-export notice)6**Report:** peach-code-review.md, Finding PCH-02-00578## Correction to the fix brief910The brief's comment text says "100,000 iterations". The code (and the report)11say **250,000** (`backup.ts:166`). The comment below uses the value the code12actually enforces — a comment that misstates its own parameters is worse than13no comment.1415## Edit 1 — KDF comment at backup.ts:1461617```typescript1819export async function derivePeachExportKey(20 password: string,21 salt: Uint8Array,22 opts: { raw?: boolean } = {}23): Promise<Uint8Array> {24252627282930313233343536373839export async function derivePeachExportKey(40 password: string,41 salt: Uint8Array,42 opts: { raw?: boolean } = {}43): Promise<Uint8Array> {44```4546(The existing LV-1 NFC comment inside the function body stays as is.)4748## Edit 2 — post-import re-export notice in Import.tsx4950Verified: there is currently **no** user-facing recommendation after a51successful PBKDF2 (`peach-json`) import. The import success path keeps the52view mounted and already surfaces a post-import `duplicateWarning` notice53(Import.tsx:790) — the legacy-KDF notice mirrors that exact mechanism.54552a. Add a signal next to `duplicateWarning` (Import.tsx:~425):5657```typescript5859 const [duplicateWarning, setDuplicateWarning] = createSignal<number>(0);6061 62 63 const [legacyKdfNotice, setLegacyKdfNotice] = createSignal(false);64```65662b. In `handleImport`, alongside `setDuplicateWarning(dupes)` (the67success tail, Import.tsx:~604):6869```typescript7071 setDuplicateWarning(dupes);72 await props.onImport();737475 setDuplicateWarning(dupes);76 77 78 setLegacyKdfNotice(currentPreview.format === "peach-json");79 await props.onImport();80```8182Also reset it where the other notices reset (`handleFileSelect`, alongside83`setError(null)` / `setAwaitingReplaceConfirm(false)`):8485```typescript86 setLegacyKdfNotice(false);87```88892c. Render next to the duplicate-warning block (Import.tsx:~790, same90`<Show>` pattern and styling class as the sibling notice):9192```tsx93 <Show when={legacyKdfNotice() && !importing()}>94 <div class="peach-settings-group">95 <div class="peach-restore-warning">96 This backup was created with Peach's older encryption format97 (PBKDF2). It imported fine — but we recommend exporting a fresh98 backup now so your paper/file backups use the current, stronger99 format.100 </div>101 </div>102 </Show>103```104105(Class choice: `peach-restore-warning` is the existing soft-warning surface106used three blocks above; no new CSS.)107108## Tests109110UI-notice coverage belongs in `src/popup/views/contracts.test.tsx` style; the111notice is a pure render-state change. Suggested single contract case (optional,112not counted as a security regression test): mock `parseImportSource` to return113`format: "peach-json"`, drive `handleImport`, assert the notice text renders.114The KDF comment itself needs no test.115116## Save message (integration)117118`fix: PCH-02-005 document legacy PBKDF2 import path + recommend re-export after legacy import`