News for hackers. Stuff that matters.

dav

iOS Data Protection — The Four Classes

Data Protection is implemented by constructing and managing a hierarchy of keys, building on the hardware encryption technologies built into Apple devices. It's controlled on a per-file basis by assigning each file to a class; accessibility is determined by whether the class keys have been unlocked.

The four protection classes, from strongest to weakest:

NSFileProtectionComplete — Files are only accessible when the device is unlocked.

NSFileProtectionCompleteUnlessOpen — A file can only be opened when the device is unlocked, but is not closed when the device is locked — it's encrypted when the last open handle is closed. Suitable for data being uploaded in the background.

NSFileProtectionCompleteUntilFirstUserAuthentication — The resource cannot be accessed until after the device has booted. After the user unlocks the device for the first time, the app can access the resource and continue to do so even if the user subsequently locks the device. Fortify This is commonly called AFU (After First Unlock). This is the default class for all third-party app data not otherwise assigned to a Data Protection class.

NSFileProtectionNone — The resource has no special protections. It can be read or written at any time. The encryption only uses a key derived from the device's UID.

The BFU/AFU Distinction — The Heart of the Signal Issue

Apple's iOS devices operate in two key security states that directly impact data accessibility: Before First Unlock (BFU) and After First Unlock (AFU).

When an iPhone is in the BFU state, it has been powered on or rebooted but not yet unlocked with a passcode. In this state, the Secure Enclave does not release the decryption keys needed to access most user data.

Once you've unlocked once (AFU), files protected with NSFileProtectionCompleteUntilFirstUserAuthentication become accessible, the Keychain is available, and background processes and apps can access encrypted content as needed.

The Signal notification content issue connects here because notification data (including previews) stored in the default CompleteUntilFirstUserAuthentication class remains decryptable by any process — including OS-level forensic tools — as long as the phone has been unlocked at least once since the last reboot.

Re:The Day Hobie Made Nixon a Surfboard on Saturday March 15, 2025 @03:00PM (#43374490)
Disc Golf holding steady I suspect.
Re:Briar: Peer to Peer Encrypted Messaging on Saturday March 15, 2025 @12:01AM (#43369875)
I spent a little time ~2012 trying to think how to create a system like this that would work with iPhones at burning man. Never really got anywhere with the idea, but I’m excited to try this!
Re:Mistakes engineers make in large established codebases on Tuesday January 07, 2025 @09:54PM (#42630388)
I have three maxims that basically power all my decisions as an engineer:

1. The three C’s: Clarity always, Consistency with determination, Concision when prudent. 2. Keep the pain in the right place. 3. Fight entropy!

So in the context of the main example in this article, I would say you can try to improve clarity by e.g. wrapping the existing auth code in something that looks nicer in the context of your new endpoint but try very hard to stay consistent for all the great reasons the article gives.

Re:Spot the Drowning Child on Wednesday July 10, 2024 @09:34AM (#40926724)
It can be all of the above.
Somewhat related, I feel like the book Thinking in Systems should be taught in high school

https://www.goodreads.com/book/show/3828902

Re:Doug Engelbart’s 1968 demo on Saturday December 09, 2023 @11:35PM (#38589095)
Tangent, but since there are mentions of history books in these comments, I highly recommend Ted Nelson’s autobiography. https://www.goodreads.com/book/show/10673124
Re:The Code Review Pyramid on Saturday July 08, 2023 @09:57PM (#36650751)
You should really do some research on this. Good luck on your journey.
Re:The Code Review Pyramid on Saturday July 08, 2023 @09:51PM (#36650721)
Wow. Great idea and overall goal, but I’m disappointed in some of the placement choices.

Tests very much in particular deserve more weight. Being DRY is nowhere on the same level as bike shedding code style.

Commenter actually read the article before commenting, like a n00b. It brings up social media and income:

"Various studies around the world have proposed different explanations, such as economic status. Lower income is associated with greater declines. One study looked at use of computer games among young people [as a possible explanation]. Some folks have tracked declines in alcohol use, and we know that [alcohol use] can be associated with disinhibition. We have seen, somewhat, [an] increase in sex toy use—from what we looked at, not a massive increase. If there is a change, it’s probably just going to contribute to one of the blips. I don’t expect it to be the explanation."

Re:What if regular exercise is the best cognitive exercise? on Saturday November 12, 2022 @11:57AM (#33574825)
Exercise (and particularly strength as opposed to cardio) is now well established to reduce many aging related effects, including around cognition.

I suggest the book Defy Aging by Beth Bennett for a HN level deep dive into the science.

Re:Alien Truth on Tuesday October 18, 2022 @02:13PM (#33251613)
Paul Graham needs to read this and get back to us.

Where Mathematics Comes From: How the Embodied Mind Brings Mathematics into Being by George Lakoff

https://www.goodreads.com/book/show/53337

Re:How to Do a Handstand on Saturday June 11, 2022 @07:27PM (#31709486)
I was working with a personal trainer on handstands for a couple of years. It’s hard! The training exercises in this article are very close to the program I did with him. Of course it’s more helpful to have 1:1 coaching but, the progression outlined here looks correct to me. Don’t forget the warm up!
Re:Show HN: I made a little math game named Summle on Friday March 04, 2022 @10:05AM (#30555807)
Another thought, having an in-app calculator (so one could free calculate factors of an arbitrary number) might generate interesting data to see the approaches your users take? I could see how that might be interesting data for cognitive mathematics research.
Re:Show HN: I made a little math game named Summle on Friday March 04, 2022 @09:55AM (#30555664)
#Summle #7: 3/5 = = =

I like it. Some UX tweaks would be nice, maybe an undo, a clear all, and perhaps some helpful focus shifting (of which tile is being intended for a click) depending on context.

The moat won’t work as well as you probably think. A lot of the problem comes from the sky raining down embers on flammable roofs and such...
Re:Biochemical Pathway Maps on Thursday June 17, 2021 @08:02PM (#27545845)
Would be great to have a citation on this
I also immediately think of the Brunner book
Re:Calibre – E-Book Management on Tuesday April 27, 2021 @07:48PM (#26963600)
I’d really love a post that just analyzed this take.
Re:Why's (Poignant) Guide to Ruby (2004) on Wednesday November 18, 2020 @11:01AM (#25138303)
ah, yes! hoodwink.d rings a bell
Re:Reasons to prefer Linux over Windows (2014) on Sunday November 15, 2020 @11:51PM (#25108147)
I have same problem. It’s 100% with Slack (and I suspected because Electron) but only occasional with Zoom and rarely with Firefox.
Re:Why's (Poignant) Guide to Ruby (2004) on Thursday November 12, 2020 @12:22AM (#25066739)
I'm pretty sure it was _why who set up the first darknet I was ever on. You had to set up your /etc/hosts and do some other tricks, to browse to hidden pages. Unless I'm confusing with another similar thing around the same time, there was some JS involved and you could find hidden features layered on regular websites.
Re:Knight vs. Snail (2013) on Thursday November 05, 2020 @10:42PM (#25004664)
Sir Peter Venkman: "He slimed me. I feel so funky"
This claim of first is not true at all. The Ruby community did all this at least a decade before Go existed, and I imagine there are other examples.
Re:Linux Productivity Tools (2019) [pdf] on Wednesday May 20, 2020 @01:04AM (#23243446)
Have not. Never heard of the Vala programming language before either. It does not seem to be a particularly popular application so definitely the kind where I would read the source first. Luckily it does seem pretty readable, so I will check it out, thanks!
Re:Linux Productivity Tools (2019) [pdf] on Wednesday May 20, 2020 @01:00AM (#23243429)
You're thinking of Skitch, I used that too before Droplr.
Re:Linux Productivity Tools (2019) [pdf] on Tuesday May 19, 2020 @12:34AM (#23231295)
I had not, just installed it though and it looks fantastic, thanks! The best I'd found previously was a no-annotation script that failed most of the time with a vague "something went wrong" error.
Re:Linux Productivity Tools (2019) [pdf] on Monday May 18, 2020 @11:13PM (#23230961)
The main thing I miss from OS X is Droplr (pain free sharing of annotated screenshots) and Jumpcut (pastebuffer history tool). Can't find anything on Linux for either of those that works nearly as well. I can still go to an old Mac for occasional needs like Final Cut Pro but those are tools I used several/dozen of times every day before.

I'm on PopOS.

Re:Cobol Still Powers the Global Economy on Wednesday July 17, 2019 @12:13AM (#20456397)
From what I understood when I worked at LiveNation, every time you buy a ticket from Ticketmaster the transaction flows through some ancient spaghetti COBOL, probably running in Phoenix.
Re:The Notion of “Trolling” in Ancient Sanskrit on Sunday May 12, 2019 @11:05AM (#19892324)
Did they have a word for the intellectually dishonest practice of just making stuff up to support one's argument?

Older »