Difference between revisions of "GID Key"

From The iPhone Wiki
Jump to: navigation, search
(adding quote from apple document)
(adding information from intercept article)
Line 1: Line 1:
The '''GID key''' (device group ID key) is the [https://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES (Advanced Encryption Standard)] 256-bit key shared by all devices with the same application processor. This key differs between each [https://en.wikipedia.org/wiki/System_on_a_chip SoC (System on a Chip)] - in other words, the [[S5L8900]] (chip for iPhone 3G and other devices of that generation) has a different key from the [[S5L8930]] (A4 chip for iPhone 4, iPod touch 4g, etc.).
+
The '''GID key''' (device group ID key) is the [https://en.wikipedia.org/wiki/Advanced_Encryption_Standard AES (Advanced Encryption Standard)] 256-bit key shared by all devices with the same application processor. It's a key part of how iOS encrypts software on the device.
   
  +
This key differs between each [https://en.wikipedia.org/wiki/System_on_a_chip SoC (System on a Chip)] - in other words, the [[S5L8900]] (chip for iPhone 3G and other devices of that generation) has a different key from the [[S5L8930]] (A4 chip for iPhone 4, iPod touch 4g, etc.).
Apple explains GID keys in its official [https://www.apple.com/br/privacy/docs/iOS_Security_Guide_Oct_2014.pdf iOS security guide] (page 9):
 
  +
  +
Apple explains GID keys in its official [https://www.apple.com/br/privacy/docs/iOS_Security_Guide_Oct_2014.pdf iOS security guide] (page 9, chapter "Encryption and Data Protection"):
 
<blockquote>"The device’s unique ID (UID) and a device group ID (GID) are AES 256-bit keys fused (UID) or compiled (GID) into the application processor during manufacturing. No software or firmware can read them directly; they can see only the results of encryption or decryption operations performed using them. The UID is unique to each device and is not recorded by Apple or any of its suppliers. The GID is common to all processors in a class of devices (for example, all devices using the Apple A8 processor), and is used as an additional level of protection when delivering system software during installation and
 
<blockquote>"The device’s unique ID (UID) and a device group ID (GID) are AES 256-bit keys fused (UID) or compiled (GID) into the application processor during manufacturing. No software or firmware can read them directly; they can see only the results of encryption or decryption operations performed using them. The UID is unique to each device and is not recorded by Apple or any of its suppliers. The GID is common to all processors in a class of devices (for example, all devices using the Apple A8 processor), and is used as an additional level of protection when delivering system software during installation and
 
restore. Integrating these keys into the silicon helps prevent them from being tampered with or bypassed, or accessed outside the AES engine. The UID and GID are also not available via JTAG or other debugging interfaces."</blockquote>
 
restore. Integrating these keys into the silicon helps prevent them from being tampered with or bypassed, or accessed outside the AES engine. The UID and GID are also not available via JTAG or other debugging interfaces."</blockquote>
Line 9: Line 11:
 
In [[iOS]] 3.0GM/3.0, a pseudo GID Key was used. This allowed getting [[Firmware Keys|firmware decryption keys]] for only these firmwares without the device and with tools such as GitKeys or OpenSSL.
 
In [[iOS]] 3.0GM/3.0, a pseudo GID Key was used. This allowed getting [[Firmware Keys|firmware decryption keys]] for only these firmwares without the device and with tools such as GitKeys or OpenSSL.
   
== Attack ==
+
== Potential attacks ==
It would be great to perform some sort of [[wikipedia:side channel attack|side channel attack]] on this to extract it:
+
A hypothetical way to extract this key could be to perform some sort of [[wikipedia:side channel attack|side channel attack]] (see also [[Talk:GID Key]] for speculation about potential attacks):
   
 
* [http://www.quovadislabs.com/ Quo Vadis Labs]
 
* [http://www.quovadislabs.com/ Quo Vadis Labs]
Line 16: Line 18:
 
* [http://www.cl.cam.ac.uk/~sps32/ECRYPT2011_2.pdf Side-channel attacks: new directions and horizons (Part 2)]
 
* [http://www.cl.cam.ac.uk/~sps32/ECRYPT2011_2.pdf Side-channel attacks: new directions and horizons (Part 2)]
 
* [http://www.cl.cam.ac.uk/~sps32/qvl_proj.html Research project: developing new technology for efficient side-channel analysis]
 
* [http://www.cl.cam.ac.uk/~sps32/qvl_proj.html Research project: developing new technology for efficient side-channel analysis]
  +
  +
=== CIA research into attacks ===
  +
  +
[https://firstlook.org/theintercept/2015/03/10/ispy-cia-campaign-steal-apples-secrets/ According to this March 2015 article] based on documents provided by Edward Snowden, the CIA has been particularly interested in figuring out how to extract GID keys as part of their efforts to get access to modifying iOS to insert spy software and to research further vulnerabilities:
  +
  +
<blockquote>"At the 2011 Jamboree conference, there were two separate presentations on hacking the GID key on Apple’s processors. One was focused on non-invasively obtaining it by studying the electromagnetic emissions of — and the amount of power used by — the iPhone’s processor while encryption is being performed. Careful analysis of that information could be used to extract the encryption key. Such a tactic is known as a “side channel” attack. The second focused on a “method to physically extract the GID key.”</blockquote>
  +
<blockquote>"According to the 2011 document describing the Jamboree presentations on Apple’s processor, the researchers asserted that extracting the GID key could also allow them to look for other potential gateways into Apple devices. “If successful, it would enable decryption and analysis of the boot firmware for vulnerabilities, and development of associated exploits across the entire A4-based product-line, which includes the iPhone 4, the iPod touch and the iPad.”"</blockquote>
  +
  +
== Related projects ==
  +
* [https://github.com/planetbeing/xpwn/tree/master/crypto crypto by planetbeing] - "This package allows you to directly access the iPhone's AES engine from userland. You may encrypt and decrypt with the UID and GID keys, as well as any custom keys you provide."
  +
* [https://code.google.com/p/iphone-dataprotection/ iphone-dataprotection] - wiki includes a list of [https://code.google.com/p/iphone-dataprotection/wiki/EncryptionKeys types of encryption keys used for data protection], including a chart of key hierarchy on iPhone 4.
   
 
[[Category:Decryption]]
 
[[Category:Decryption]]

Revision as of 08:55, 10 March 2015

The GID key (device group ID key) is the AES (Advanced Encryption Standard) 256-bit key shared by all devices with the same application processor. It's a key part of how iOS encrypts software on the device.

This key differs between each SoC (System on a Chip) - in other words, the S5L8900 (chip for iPhone 3G and other devices of that generation) has a different key from the S5L8930 (A4 chip for iPhone 4, iPod touch 4g, etc.).

Apple explains GID keys in its official iOS security guide (page 9, chapter "Encryption and Data Protection"):

"The device’s unique ID (UID) and a device group ID (GID) are AES 256-bit keys fused (UID) or compiled (GID) into the application processor during manufacturing. No software or firmware can read them directly; they can see only the results of encryption or decryption operations performed using them. The UID is unique to each device and is not recorded by Apple or any of its suppliers. The GID is common to all processors in a class of devices (for example, all devices using the Apple A8 processor), and is used as an additional level of protection when delivering system software during installation and restore. Integrating these keys into the silicon helps prevent them from being tampered with or bypassed, or accessed outside the AES engine. The UID and GID are also not available via JTAG or other debugging interfaces."

It was used to generate AES Key 0x837. See AES Keys and KBAG.

In iOS 3.0GM/3.0, a pseudo GID Key was used. This allowed getting firmware decryption keys for only these firmwares without the device and with tools such as GitKeys or OpenSSL.

Potential attacks

A hypothetical way to extract this key could be to perform some sort of side channel attack (see also Talk:GID Key for speculation about potential attacks):

CIA research into attacks

According to this March 2015 article based on documents provided by Edward Snowden, the CIA has been particularly interested in figuring out how to extract GID keys as part of their efforts to get access to modifying iOS to insert spy software and to research further vulnerabilities:

"At the 2011 Jamboree conference, there were two separate presentations on hacking the GID key on Apple’s processors. One was focused on non-invasively obtaining it by studying the electromagnetic emissions of — and the amount of power used by — the iPhone’s processor while encryption is being performed. Careful analysis of that information could be used to extract the encryption key. Such a tactic is known as a “side channel” attack. The second focused on a “method to physically extract the GID key.”

"According to the 2011 document describing the Jamboree presentations on Apple’s processor, the researchers asserted that extracting the GID key could also allow them to look for other potential gateways into Apple devices. “If successful, it would enable decryption and analysis of the boot firmware for vulnerabilities, and development of associated exploits across the entire A4-based product-line, which includes the iPhone 4, the iPod touch and the iPad.”"

Related projects