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.
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
peel assessreads the archive’s headers and says what is realistic. It tries no password and reads no protected data.peel find-originalschecks whether the files inside are already on disk. If they are, you do not need the password.peel unlockopens a legacy ZipCrypto ZIP from a copy of one file inside it, with no password.peel recovertries passwords generated from what you remember. It is a bounded search, not a cracker.peel recover-planruns the steps above in a fixed order and explains where it stands.- For damage,
peel salvage,peel recover-streamandpeel repair, covered below.
Use peel test to confirm a result. See Check an archive.
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
peel assess locked.zippeel 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.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.
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.
peel find-originals locked.zip projectpeel 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.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.
peel unlock legacy.zip project --no-default-locations -o unlockedpeel 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.peel 1.4.0, recorded 2026-11-26.What it needs:
- A ZipCrypto archive. WinZip AES archives, which
peel create --password-stdinmakes, have no such route. Peel says it could not recover them. - A copy of one stored or deflated entry, with at least a dozen bytes of real content. The match is on size and CRC-32, never on the file name, so a renamed copy works.
- For a deflated entry, a copy that recompresses to exactly the stored length. Peel tries deflate levels 6, 9 and 1.
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):
peel unlock legacy.zip --known 'project/docs/chapter-1.md=old/notes.txt' --no-default-locations -o unlockedA file’s type alone, such as its magic bytes, is not accepted. It was measured and gives too little to work from.
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.
peel recover old.zip --base rover --caps --year-from 2010 --year-to 2016 -o recoveredTrying 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.
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-repairNothing 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.
peel salvage damaged.zip -o salvagedpeel salvage damaged.zip -o salvaged
Salvaged 5 file(s) to salvaged (5 recovered, 0 partial, 0 unrecoverable).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.
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.
peel recover-stream broken.tar -o recoveredRepair 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 1peel 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 0peel 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.
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 |
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);/* 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
- Strong encryption has no shortcut. WinZip AES, 7z AES-256 and RAR AES open with the password, or you work from unencrypted copies.
- Recall searches only the list your hints generate. A password outside it is not covered, and a miss is not proof of anything.
peel unlockneeds a real copy of one file in a ZipCrypto archive, and cannot work from a file type.- Salvage returns what is readable and says what it could not. PAR2 repair needs enough surviving blocks.
- Nothing here is a remote service. Archives and hints stay on your Mac.
void peel_string_free(char *s) Free a JSON string returned by any peel_* call.char *peel_unlock_known(const char *archive_path, const char *roots, const char *known, const char *dest_dir) peel_unlock with explicit originals: newline-separated ENTRY<tab>FILE pairs.peel assess Look at a locked archive and say whether recovery is realistic, without trying a single password: the encryption scheme, whether file names are hidden, multi-volume state, and a feasibility rating.peel find-originals Search folders for files that match what is inside a locked archive, by name and size.peel recover Try to recover a forgotten password from what you remember: words you use, numbers, years, separators.peel salvage Recover readable files from a damaged or truncated ZIP, tar, bzip2 or single compressed stream that a normal extract refuses.peel test Read every entry to the end and report which fail.peel unlock Open a ZipCrypto ZIP without its password, from a copy of one of its files that you still have.assess_archive RecoveryAssessment: encryption, metadata visibility, volumes, feasibility, techniques, notes.salvage ZIP by local-header scan, the tar family keeping whole entries up to a truncation.