Guides

Recover and repair

Ask peel assess what is realistic first, then use the route that fits: find the files, unlock a legacy ZIP, search from what you remember, salvage or repair.

Peel 1.4.0 · Snack Studio · Updated

Two different problems get called “recovery”. A locked archive is intact but you lack the password. A damaged archive is missing bytes. Different commands handle each, and none of them weakens any cipher.

Try things in this order

  1. peel assess reads the archive’s headers and says what is realistic. It tries no password and reads no protected data.
  2. peel find-originals checks whether the files inside are already on disk. If they are, you do not need the password.
  3. peel unlock opens a legacy ZipCrypto ZIP from a copy of one file inside it, with no password.
  4. peel recover tries passwords generated from what you remember. It is a bounded search, not a cracker.
  5. peel recover-plan runs the steps above in a fixed order and explains where it stands.
  6. For damage, peel salvage, peel recover-stream and peel repair, covered below.

Use peel test to confirm a result. See Check an archive.

Free CLI, Pro app. In the Mac app, guided recall, copying the originals into a folder and the ZipCrypto unlock are Peel Pro features (the Peel Pro page). Assessment and finding originals stay free there. The peel command does not check for a licence, and the plan is to keep it that way through 1.x. Everything here runs on your own archive, on your own Mac.

Assess first

TerminalShell
peel assess locked.zip
peel assess locked.zip
path:          locked.zip
format:        zip
encryption:    WinZip AES-256
file list:     readable
entries:       11
volumes:       single file
intact:        yes
feasibility:   uncertain
techniques:    memory reconstruction, find the originals

• WinZip AES-256 is strong. There is no shortcut: recovery depends on what you remember, or on finding the original files.
Real output from peel 1.4.0, recorded 2026-11-26.

The fields come from the archive’s headers:

Field Meaning
encryption The scheme: none, ZipCrypto (legacy, weak), WinZip AES, 7z AES-256, RAR AES.
file list Whether names are readable. Header-encrypted 7z and RAR hide them.
volumes Single file, or whether a multipart set is complete.
intact Whether the container is structurally sound.
feasibility plausible, uncertain or unrealistic.
techniques The routes that apply to this archive.

Feasibility describes the archive, not your chances. WinZip AES-256 reports uncertain because recovery depends on what you remember or on finding the files. With -j you also get a recovery_plan with the ordered steps, and a recovery_contract whose verdict.class says why. The verdict here is no_practical_path: for this kind of encryption there is no way in without the password or an unencrypted copy.

TerminalShell
peel assess -j locked.zip | jq -r '.recovery_contract.verdict.class'

Assessment exits 0 for an archive it can read, even one that is not encrypted (that reports plausible and “not encrypted”). Branch on the JSON, not the exit code. Document formats are assessed too: PDF and OOXML Office files (.docx, .xlsx, .pptx).

Find the originals

If the archive’s file names are readable, peel find-originals searches the folders you name for files that match the archive’s entries by base name and exact size.

TerminalShell
peel find-originals locked.zip project
peel find-originals locked.zip project
8 of 8 file(s) inside were found on disk.
  project/docs/chapter-3.md  ←  project/docs/chapter-3.md
  project/docs/chapter-6.md  ←  project/docs/chapter-6.md
  project/docs/chapter-2.md  ←  project/docs/chapter-2.md
  project/docs/chapter-5.md  ←  project/docs/chapter-5.md
  project/docs/chapter-1.md  ←  project/docs/chapter-1.md
  project/docs/chapter-4.md  ←  project/docs/chapter-4.md
  project/README.md  ←  project/README.md
  project/src/main.rs  ←  project/src/main.rs

You already have these files, so you may not need the password at all.
Run again with -o DIR to copy them into a folder.
Real output from peel 1.4.0, recorded 2026-11-26.

Add -o DIR to copy the matches into a folder. It follows no symlinks and stops at a file and depth budget, so pointing it at a large folder is safe. It cannot work when names are encrypted, because there is nothing to match.

Unlock a legacy ZIP

ZipCrypto is the old ZIP cipher. If you still have an unencrypted copy of any one file inside the archive, Peel recovers the archive’s internal keys from it and decrypts every entry. The password stays unknown, and Peel does not claim otherwise.

TerminalShell
peel unlock legacy.zip project --no-default-locations -o unlocked
peel unlock legacy.zip project --no-default-locations -o unlocked
Looking for a copy of one of the archive's files in: project
Recovered, using "project/docs/chapter-1.md" (matched project/docs/chapter-1.md).
Wrote 3 file(s) to unlocked.
Real output from peel 1.4.0, recorded 2026-11-26.

What it needs:

By default Peel also searches the archive’s folder, ~/Downloads and ~/Desktop. Add --no-default-locations in scripts so the search covers only the folders you name. To point at a copy directly, use --known ENTRY=FILE (repeatable):

TerminalShell
peel unlock legacy.zip --known 'project/docs/chapter-1.md=old/notes.txt' --no-default-locations -o unlocked

A file’s type alone, such as its magic bytes, is not accepted. It was measured and gives too little to work from.

Exit 0 on failure. peel unlock exits 0 even when it could not recover the archive. With -j, read recovered: {“entries_total”: 8, “extracted”: [], “found_at”: null, “recovered”: false, “unlocked_by”: null}.

Search from what you remember

peel recover turns remembered habits into a bounded, ordered list and tries each against the archive. It stops at the first one that opens it, then extracts into -o.

TerminalShell
peel recover old.zip --base rover --caps --year-from 2010 --year-to 2016 -o recovered
Text
Trying 45 candidate(s) from what you remember…
  0/45  25/45
Found the password.
Extracted 11 item(s) to recovered
Flag Adds
--base WORD A word you tend to use. Repeat for several.
--year-from YEAR, --year-to YEAR A range of plausible years.
--number N, --sep S A number you often append, and a separator before it. Repeatable.
--caps, --leet, --endings Capitalised variants, letter-to-digit swaps, common endings such as !.
--budget N A cap on candidates generated.
--pcfg Try common password shapes first. Opt-in, because it can push a bare word later.
--show-password Print the password. Off by default.
--measure Measure checks per second on this Mac, then stop.

--measure with your hints also estimates the run: ~60 candidate(s) from what you remember; at this rate, under a second to try them all. Do this before a large search. The cost of each guess is set by the format. In the recorded benchmark (10-core Apple silicon, 2026-11-07), WinZip AES-256 checked about 12,000 a second, 7z AES-256 about 737 and RAR5 about 389. ZipCrypto checked about 458,000.

If nothing matches, it exits 1 with none of the candidates worked; try more of what you remember. That means the password is not in the list you described. It does not mean the archive is unrecoverable. -j does not change the output of recover today.

Let the plan drive

peel recover-plan shows the ordered steps and attempts the safe ones you give inputs for.

TerminalShell
peel recover-plan locked.zip                       # preview only
peel recover-plan legacy.zip -o out --from project # known-plaintext route
peel recover-plan locked.zip -o out --base horse   # bounded recall search
peel recover-plan damaged.zip -o out --allow-repair

Nothing is attempted until you pass -o, and -o must not be the archive’s own folder. The steps are check_saved_passwords, find_unencrypted_copies and recall_search. Peel never reads your saved passwords. That step stays pending until you supply one. --allow-repair adds a salvage step that writes into -o. The -j output has three keys: session, diagnostics and recovered, the output folder or null.

Damaged archives

Salvage

peel salvage recovers what is readable from a ZIP whose central directory is gone, usually because the file was cut short. It scans for local file headers and decompresses each member on its own, so one bad member does not stop the rest.

TerminalShell
peel salvage damaged.zip -o salvaged
peel salvage damaged.zip -o salvaged
Salvaged 5 file(s) to salvaged (5 recovered, 0 partial, 0 unrecoverable).
Real output from peel 1.4.0, recorded 2026-11-26.

Every file is reported as recovered (decompressed, CRC matched), partial (bytes written, truncated or CRC mismatch) or unrecoverable. With -j you get those counts, an outcomes array and the written paths. Salvage reports what it wrote. It cannot know what the original contained, so compare the count with what you expect.

A known gap in 1.4.0. The run above recovers five of the eight files: salvage can miss a file stored straight after a folder entry, even when its bytes survive. The next release fixes it; until then, check the count.

It also handles tar and compressed tar (whole entries up to the break), bzip2 (block by block) and a 7z whose end header survives. Any other single compressed stream (.gz, .xz, .zst, and so on) yields its readable prefix. Encrypted archives and 7z with a lost header are reported, not guessed.

Recover-stream

For a damaged PNG, ustar tar or PDF, peel recover-stream makes one forward pass and writes three files into -o: recovered.bin (same length as the input), recovered.mask (one bit per byte) and report.json. A mask bit is set only for bytes that passed their format’s own check: a PNG chunk CRC-32, a tar header checksum, or a PDF Flate stream that inflated with a matching Adler-32. Everything else is “probable” or zeroed. It refuses to replace existing files and exits 14.

TerminalShell
peel recover-stream broken.tar -o recovered

Repair from PAR2

If a .par2 set sits beside the file, peel repair verifies it and rebuilds damaged or missing blocks exactly. It needs no password. Point it at the data file or at the .par2 index. Use --check to verify without changing anything.

peel repair --check parity.zip; echo "exit $?"
1 damaged, 0 missing; repair possible (2 blocks needed, 61 available).
  DAMAGED: parity.zip (2 block(s))
peel: 1 damaged, 0 missing; run without --check to repair
exit 1
Real output from peel 1.4.0, recorded 2026-11-26.
peel repair parity.zip; echo "exit $?"
Repaired 1 file(s) from parity (2 blocks rebuilt).
  REPAIRED: parity.zip (2 block(s))
exit 0
Real output from peel 1.4.0, recorded 2026-11-26.

A file is called repaired only after the set re-verifies it. If too few blocks survive, it says how many were needed and how many are available, and changes nothing. Peel verifies and repairs PAR2. It does not create parity sets. (The captures above used par2 only to make the demo set.) Peel does not repair RAR.

Check an archive

peel test reads every entry to the end and checks it. Use it to confirm a recovery, or to find out an archive is damaged before you rely on it.

TerminalShell
peel test -j archive.zip | jq -e '.ok'

It exits 0 when every entry passes, 5 when the archive cannot be read, and 1 when entries fail. The scripting guide shows it in CI.

From Rust and C

The same steps are library calls. Each C call returns a JSON string that you free with peel_string_free. A failure is the error object from Errors and exit codes.

CLI Rust (peel-core) C
peel assess assess_archive peel_assess(path)
peel find-originals find_originals, assemble_originals peel_find_originals(path, roots)
peel unlock recover_zipcrypto peel_unlock(path, roots, dest), peel_unlock_known(path, roots, known, dest)
peel recover-plan plan peel_recover_plan(path, search_dirs, dest, bases, allow_repair)
peel salvage salvage peel_salvage(path, dest)
peel recover generate_candidates, test_candidates, measure_check_rate none
peel test test_archive none
peel repair repair_par2, verify_par2 none
Rust
use peel_core::{assess_archive, salvage};

let a = assess_archive(path)?;                    // RecoveryAssessment
println!("{:?}", a.feasibility);

let s = salvage(path, "recovered".as_ref())?;     // SalvageReport
println!("{} recovered, {} partial", s.recovered, s.partial);
C
/* known: newline-separated ENTRY<tab>FILE pairs, matched on contents */
char *json = peel_unlock_known("legacy.zip", "", "project/README.md\tcopy/readme.txt", "out");
puts(json);
peel_string_free(json);

peel_recover_plan takes search_dirs and bases as newline-separated strings (either may be empty or NULL). With a NULL dest_dir it previews the plan and attempts nothing. It never reads saved passwords and never modifies the archive. See the Rust library and C library references.

Limits