Apple ordered to bypass auto-erase on San Bernadino shooter's iPhone
I thought this was an excellent write-up regarding how the iOS security platform (recent iPhone models) works from someone obviously in the know, as posted in the forums of Apple Insider.  (Source: <a href="http:&#x2F;&#x2F;forums.appleinsider.com&#x2F;discussion&#x2F;191851" rel="nofollow">http:&#x2F;&#x2F;forums.appleinsider.com&#x2F;discussion&#x2F;191851</a>)<p>&quot; Apple uses a dedicated chip to store and process the encryption. They call this the Secure Enclave. The secure enclave stores a full 256-bit AES encryption key.<p>Within the secure enclave itself, you have the device&#x27;s Unique ID (UID) . The only place this information is stored is within the secure enclave. It can&#x27;t be queried or accessed from any other part of the device or OS. Within the phone&#x27;s processor you also have the device&#x27;s Group ID (GID). Both of these numbers combine to create 1&#x2F;2 of the encryption key. These are numbers that are burned into the silicon, aren&#x27;t accessible outside of the chips themselves, and aren&#x27;t recorded anywhere once they are burned into the silicon. Apple doesn&#x27;t keep records of these numbers. Since these two different pieces of hardware combine together to make 1&#x2F;2 of the encryption key, you can&#x27;t separate the secure enclave from it&#x27;s paired processor.<p>The second half of the encryption key is generated using a random number generator chip. It creates entropy using the various sensors on the iPhone itself during boot (microphone, accelerometer, camera, etc.) This part of the key is stored within the Secure Enclave as well, where it resides and doesn&#x27;t leave. This storage is tamper resistant and can&#x27;t be accessed outside of the encryption system. Even if the UID and GID components of the encryption key are compromised on Apple&#x27;s end, it still wouldn&#x27;t be possible to decrypt an iPhone since that&#x27;s only 1&#x2F;2 of the key.<p>The secure enclave is part of an overall hardware based encryption system that completely encrypts all of the user storage. It will only decrypt content if provided with the unlock code. The unlock code itself is entangled with the device&#x27;s UDID so that all attempts to decrypt the storage must be done on the device itself. You must have all 3 pieces present: The specific secure enclave, the specific processor of the iphone, and the flash memory that you are trying to decrypt. Basically, you can&#x27;t pull the device apart to attack an individual piece of the encryption or get around parts of the encryption storage process. You can&#x27;t run the decryption or brute forcing of the unlock code in an emulator. It requires that the actual hardware components are present and can only be done on the specific device itself.<p>The secure enclave also has hardware enforced time-delays and key-destruction. You can set the phone to wipe the encryption key (and all the data contained on the phone) after 10 failed attempts. If you have the data-wipe turned on, then the secure enclave will nuke the key that it stores after 10 failed attempts, effectively erasing all the data on the device. Whether the device-wipe feature is turned on or not, the secure enclave still has a hardware-enforced delay between attempts at entering the code: Attempts 1-4 have no delay, Attempt 5 has a delay of 1 minute. Attempt 6 has a delay of 5 minutes. Attempts 7 and 8 have a delay of 15 minutes. And attempts 9 or more have a delay of 1 hour. This delay is enforced by the secure enclave and can not be bypassed, even if you completely replace the operating system of the phone itself. If you have a 6-digit pin code, it will take, on average, nearly 6 years to brute-force the code. 4-digit pin will take almost a year. if you have an alpha-numeric password the amount of time required could extend beyond the heat-death of the universe. Key destruction is turned on by default.<p>Even if you pull the flash storage out of the device, image it, and attempt to get around key destruction that way it won&#x27;t be successful. The key isn&#x27;t stored in the flash itself, it&#x27;s only stored within the secure enclave itself which you can&#x27;t remove the storage from or image it.<p>Each boot, the secure enclave creates it&#x27;s own temporary encryption key, based on it&#x27;s own UID and random number generator with proper entropy, that it uses to store the full device encryption key in ram. Since the encryption key is also stored in ram encrypted, it can&#x27;t simply be read out of the system memory by reading the RAM bus.<p>The only way I can possibly see to potentially unlock the phone without the unlock code is to use an electron microscope to read the encryption key from the secure enclave&#x27;s own storage. This would take considerable time and expense (likely millions of dollars and several months) to accomplish. This also assumes that the secure enclave chip itself isn&#x27;t built to be resistant to this kind of attack. The chip could be physically designed such that the very act of exposing the silicon to read it with an electron microscope could itself be destructive.&quot;