What Is a Panic PIN? How Duress Codes Protect Your Photos

iOS has no built-in duress or panic code. What happens when someone forces you to unlock your phone, and which apps handle it properly.

Inner Gallery7 min readUpdated November 15, 2026
SecurityPrivacy
In short
  • A Panic PIN is a second code that opens a decoy vault instead of the real one.
  • It covers coercion: encryption stops helping once someone forces you to type the correct code.
  • US courts are split, and the Ninth Circuit allows compelled biometric unlocking with a warrant.
  • A decoy space filled with believable photos holds up better than a data wipe or an empty screen.

The coercion problem encryption doesn't solve

Encryption protects data from being read without the key. It does nothing when someone is standing next to you demanding the key.

Security research calls this the rubber-hose attack: the attacker doesn't break the math, they pressure the person who holds the password. Once you type the correct PIN under pressure, ChaCha20-Poly1305 encryption changes nothing and the vault opens.

How a Panic PIN works

The concept comes from the security industry. Home alarm systems have used duress codes for decades: a special code appears to disarm the alarm but silently alerts the monitoring company. Banks use silent alarms triggered by specific PINs, and Bruce Schneier discussed duress codes for fingerprint systems back in 2017.

Your real spacesWhat you protectUsual PINDecoy spaceWhat the other person seesPanic PIN
Two codes on the same lock screen, two different contents.
1
Set a primary PIN
It opens your real vault with your actual photos.
2
Set a Panic PIN
A different code.
3
If coerced, enter the Panic PIN
The app opens a secondary space that looks and behaves like a real vault. Your actual photos stay encrypted and invisible.

The person watching sees an unlocked vault with the photos you placed in it. This is plausible deniability applied to photo storage.

Courts can force you to unlock your phone

ContextRuleSource
US, Ninth CircuitBiometric unlock compellable with a warrant2025 ruling
US, D.C. CircuitCompelled fingerprint implicates the Fifth AmendmentEarly 2025 ruling
United KingdomUp to 2 years for refusingRIPA, section 49
AustraliaBroad powers to compel accessAssistance and Access Act
US borderDevice searches without a warrantCBP

The Fifth Amendment protects against self-incrimination through "testimonial" acts, and US courts have debated for over a decade whether typing a passcode counts. Passcodes have stronger protection than biometrics, but not everywhere. A 2026 analysis from a Florida criminal defense firm noted that if police have a warrant and your phone uses biometrics, they can access it.

In the UK, refusing to provide a decryption key is a criminal offense, with up to five years in prison for national security cases. At US ports of entry, a 2023 report by the Knight First Amendment Institute documented thousands of device searches annually.

Three approaches to duress codes in apps

ApproachWhat the other person seesLimit
Data wipeAn emptied appSuspicious, evidence destroyed
Decoy screenA fake screen or empty vaultThin under scrutiny
Functional secondary spaceA normal vault with photosMust be filled in advance

GrapheneOS offers a duress PIN that wipes the device on entry, and Discovery Bank in South Africa launched a panic code that freezes the account. In legal contexts, courts can draw adverse inferences from destroyed data.

In the third approach, the decoy space holds your decoy photos (vacation pictures, memes) and is indistinguishable from a primary space.

What to look for in a Panic PIN implementation

Points to check
Decoy contentreal photos that you placed there. A blank screen fails immediately
Response timeidentical whichever PIN is entered (constant-time comparison), to prevent timing side-channel attacks
Filesystemif forensic tools show two encrypted containers of different sizes, plausible deniability breaks
Biometricsif the app opens with Face ID and someone compels you to look at the phone, the Panic PIN is bypassed

To disable biometrics quickly on iPhone, press and hold the side button and a volume button. The SOS screen appears and Face ID stays disabled until the passcode is entered.

Inner Gallery's Panic PIN implementation

In Inner Gallery, the Panic PIN opens a fully functional secondary space with its own photo library and its own ChaCha20-Poly1305 encryption.

Inner Gallery lock screen with its PIN keypadInner Gallery settings: app icon, change PIN, Panic PIN and iCloud Sync
The same lock screen accepts both codes. The Panic PIN is turned on in the settings.
Details from the security architecture
Constant-time PIN verificationa dummy PBKDF2 derivation also runs on the Panic PIN path. Response time does not reveal which PIN was entered
Interfacesame animations, same layout, same features as any other space
Per-space encryptioneach space has its own key, derived from its own PIN. Opening one reveals nothing about the existence or contents of the others
Server-side metadatanone. The app runs with no third-party server and no account, so there is no server log or account activity. Panic spaces are never synced to iCloud

When a Panic PIN matters

Coercion scenarios
Domestic abuseone of the most common scenarios, and the National Network to End Domestic Violence documents how technology-facilitated abuse frequently involves forced device access
Border crossingsCBP conducted over 45,000 device searches in fiscal year 2024. You can refuse, but your device can be detained
Theft and robberycoerced unlocking is common enough that Apple built Stolen Device Protection into iOS 17.3
Workplace pressuresomeone with authority pressuring you to show your phone

The most realistic scenario often involves a partner, family member, or acquaintance rather than law enforcement. The iOS Hidden Album falls short here because it unlocks with the device passcode, which the other person likely knows.

The limits of plausible deniability

  • Forensic analysis. With physical device access, extraction tools like GrayKey or Cellebrite may detect traces of multiple encrypted containers, even without decrypting them. Plausible deniability works against casual observation, not necessarily against a full forensic examination.
  • Destroying evidence. Using a wipe-style duress code after a court order could result in obstruction charges or contempt of court. A decoy space doesn't destroy anything, and the real data remains encrypted. Consult a lawyer if you're in a legal situation.
  • Preparation. An empty Panic PIN space is suspicious. Fill it with believable decoy photos before you need it.

Related reading:


Download Inner Gallery