How fairplay-decrypt Pulls DRM Decryption Off the Device

A jailbroken iPhone gives up one 16-byte credential. Everything after that runs on a laptop, offline.

7 min read • View on GitHub • More from EthanArbuckle

An overhead view of a sparse workbench. On the left, a jailbroken iPhone with its back panel open releases a single small machined key; on the right, a laptop sits beside an IPA archive spilled open into loose numbered pages, with one taut thread connecting the key to the archive. The empty white space between the two machines carries the article's central claim: the device produces one object and the laptop does the rest, offline.
The whole architecture in one frame: one key leaves the device, everything else happens on the host.
Key Takeaways

One Phone, One Key, One Laptop

Every iOS app-dumping tool before this one ran on the phone. The phone held the app, the phone held the keys, the phone did the work. fairplay-decrypt splits that in half.

The repository has two halves that barely touch. On the host, decrypt.py and core.py handle the IPA: parsing the archive, finding the encrypted binaries, deriving keys, decrypting pages, and writing a new IPA. On the device, credential-retrieval/ runs a small set of signed binaries over USB SSH and returns a single 16-byte credential.

That is the whole contract. The host never runs code on the device beyond those binaries, and the only data that crosses back is 16 bytes. Everything else happens on a laptop, offline, on macOS or Linux.

The host side is pure Python with one dependency, cryptography>=41. No Frida, no injected libraries, no live process to babysit. Once the credential is in hand, the device can be unplugged.

What the Device Still Has to Do

The device has one job, and it is deliberately small. It runs three signed binaries over USB SSH: idevice_id to find the device, iproxy to open the tunnel, and root SSH with key authentication to talk to it. The device gathers runtime state, derives the account-bound value, and hands it back.

The host orchestrator in retrieve.py finds a suitable license record, either from an IPA the user supplies or from the installed apps on the device. It enforces the selection rules before anything leaves the host: exactly one distinct license selector, or an explicit override.

The surface stays narrow by design. Temporary directories use randomized names from secrets.token_hex(8). Shell arguments are quoted with shlex.quote. Remote filenames are checked against an allowlist. Cleanup runs through both atexit and an explicit method.

Decrypt FairPlay-encrypted apps using a 16-byte credential for the account that owns each IPA.

Project README, Repository documentation · README.md

You do not need to understand how the credential is derived to understand why the split matters. The derivation is the only thing that has to happen on the device. Everything downstream is metadata the host reads from the archive, not code it runs.

The Split, Side by Side

The iOS decryption ecosystem sorts into two camps: tools that decrypt on the device, and this one, which decrypts off it. The distinction is not speed or quality. It is where the trust lives.

ToolWhere decryption runsDevice access requiredApproach
fairplay-decryptHost (macOS or Linux), offlineJailbroken device for credential retrieval onlyCredential plus SINF/SUPF metadata drives per-page key derivation
frida-ios-dumpDeviceJailbroken device, running appFrida-based runtime dump
ClutchDeviceJailbroken deviceOn-device command-line dump
dumpdecryptedDeviceJailbroken device, running processRuntime library injection to dump Mach-O

The three alternatives are related, not exact substitutes. They solve the same practical problem from a different seat: one that keeps the phone in the loop for the whole operation. The older tools are plausible precursors to the broader ecosystem, though the record does not establish that they directly influenced this repository.

From One Credential to Every Page

One credential does not decrypt one binary. It fans out. Every encrypted binary inside an IPA carries its own SINF and SUPF records, and each one combines with the same credential to produce its own per-page keys.

One credential, many binaries. Hover a binary to trace its path; click to see its format. The sequence is the point: credential first, then derivation, then pages unlocking, all on the host.

The tool supports SUPF v3 and v5, and both 448-byte and 440-byte priv records (the 440-byte form requires a zero trailer). After decryption, cryptid is cleared so the binary reads as unencrypted. The fan-out is why the host needs no live process: the metadata in the archive tells it what to do with each binary, and the credential tells it how.

A Reverse-Engineering Tool That Refuses to Be Sloppy

Reverse-engineering tools often parse optimistically. This one does not. The Python side rejects duplicate ZIP member names, a known source of ambiguity bugs. It refuses to overwrite output. It refuses input and output that resolve to the same path. It validates the credential length before any work begins, and writes results temp-first before moving them into place.

A tight close-up of a narrow mail slot in a heavy door. A hand on the left pushes a small, precisely machined key through the slot while a different hand on the right receives it above an open book of numbered pages. The narrow slot stands for the 16-byte credential interface; the numbered pages stand for the per-page decryption that happens on the host.
The trust boundary up close: one key crosses, the pages are done elsewhere.

The C side carries the same habit. It builds with -Wall -Wextra -Werror, -fwrapv, and -fno-strict-aliasing. Its read_file and write_new helpers check fstat sizes against a 32 MB cap and fsync before close. Both languages re-check atom sizes, container counts, and record lengths before trusting a byte. In security research, sloppy tooling corrupts evidence and leaks data. Discipline here is not decoration. It is the difference between a tool you would cite and one you would not.

The Word "Authorized" Is Doing a Lot of Work

The README frames the tool for authorized use. The person decrypting must own the account that bought the app. Report that accurately, because it is the project's own stated boundary and it is not nothing.

But a policy statement is not a technical control. The credential is account-bound, so the tool cannot decrypt arbitrary content it has no account for. That constraint is real, and the README says so. It is also a speed bump, not a wall. A credential tied to one account still opens every binary in every IPA that account downloaded, and the account is the user's own.

Would love to see if I could vibe-code a patch to disable ads on ESPN+

sjtgraham, Hacker News commenter · Offline FairPlay DRM Decryption

That comment appeared in one of the two Hacker News threads about the project. It is a reaction, not evidence that anyone modified a commercial app. It does show where readers go the moment a decryption tool lands: straight to the uses the authorization framing does not cover.

One more thing worth flagging. The repository's license field is blank in the metadata. That affects how the code's legal status can be described, and it is the kind of gap that matters more for a circumvention tool than for a weekend library. This is a description of the project, not a how-to, and not a legal conclusion.