Difference between revisions of "Firmware Keys"

From The iPhone Wiki
Jump to: navigation, search
(new table - temporary save)
(Firmware Versions: 16.x placeholder)
 
(725 intermediate revisions by 32 users not shown)
Line 1: Line 1:
  +
__NOTOC__
== Introduction ==
 
  +
'''Firmware Keys''' are keys which decrypt bootloaders, ramdisks, and [[:/|root filesystem]] of iOS [[firmware]], if those components are encrypted. Apple uses encryption to make it harder to analyze and modify them. Over time Apple changed the way they encrypt firmware files, hence the way to decrypt them and get decryption keys changed as well.
These keys are for use with the tool "VFDecrypt" to decrypt the root filesystem DMG found in every IPSW. The DMG that you are after is the bigger one, in the case of the most recent builds, it can sometimes be 400+ MB!
 
   
== VFDecrypt Usage ==
+
== History ==
  +
With the release of the iPhone came the [[S5L File Formats#IMG2|IMG2]] file format. They were used on all known [[iOS|iPhone OS]] [[#1.x|1.x]] firmwares. For the 1.1.x series, they were encrypted with the [[AES Keys#Key 0x837|0x837 key]]. The discovery of the 0x837 key led to the ability to decrypt ''any'' 1.x firmware.
mac: ./vfdecrypt -i <dmg> -o decrypted_fs.dmg -k <key>
 
windows: vfdecrypt.exe -i <dmg> -o decrypted_fs.dmg -k <key>
 
   
  +
Following IMG2 came the [[IMG3 File Format|IMG3]] file format. They were introduced with iPhone OS [[#1.x.2F2.x|2.0 beta 4]], and have been in use ever since. In order to maintain their integrity, they use multiple layers of encryption. Apple took encryption seriously with IMG3 by utilizing [[wikipedia:Advanced Encryption Standard|AES]] (based on the [[wikipedia:Rijndael key schedule|Rinjndael key schedule]]). In terms of the pre-iPhone OS 3 [[VFDecrypt]] key, it is stored as plain-text in the "__restore" segment of the ASR image within the [[ramdisk]]s.
== Gaps ==
 
As you will notice, there may be a gap or two, or a key for a current build that is not there. Please feel free to add them, but please be sure that it is only the key for a User or Developer build, as if you gave the key for another type of build that might or may not be out there '''people could get in trouble, and we do not want that'''. Thanks for contributing!
 
   
  +
The ramdisk keys can ''only'' be retrieved with the processor specific [[GID Key]]. The GID key is currently unretrievable and can only be utilized through the built-in [[AES Keys|AES engine]]. To complicate things ''even more'', the engine is only accessible through a special [[bootrom]] or [[iBoot]] exploit ([[jailbreak]]s typically expose it with [[/dev/aes_0]]). This makes usage of the key nearly impossible.
== AutoDecrypt==
 
AutoDecrypt is another program currently being developed, it is a GUI (with Terminal/CMD optional) that will automatically decrypt the .dmg comparing it against a database of known vfdecrypt keys. It is being developed originally for Windows, but a Linux version will follow soon (and possibly Mac if someone will port it).
 
   
  +
However, once you have access to the AES engine, the entire system falls apart. You are able to upload an encrypted ramdisk and grab the decryption keys for it. Once you manage to decrypt the ramdisk, you can run it through [[GenPass]] to decrypt the firmware key.
== Downloads ==
 
{| class="wikitable" style="text-align: center; width: auto; table-layout: fixed; border-collapse: collapse;" border="1"
 
|-
 
! Program Name
 
! Creator
 
! Credit
 
! [[wikipedia:GitHub|GitHub]]
 
! Interface
 
! [[wikipedia:Microsoft Windows|Windows]] ([[wikipedia:32-bit|x86]])
 
! [[wikipedia:Microsoft Windows|Windows]] ([[wikipedia:64-bit|x64]])
 
! [[wikipedia:Mac OS X|Mac OS X]] ([[wikipedia:Universal binary|Universal]])
 
! [[wikipedia:Mac OS X|Mac OS X]] ([[wikipedia:List of Intel microprocessors|Intel]])
 
! [[wikipedia:Mac OS X|Mac OS X]] ([[wikipedia:PowerPC|PowerPC]])
 
! [[wikipedia:Linux|Linux]] (.[[wikipedia:deb (file format)|deb]])
 
! [[wikipedia:Linux|Linux]] (.[[wikipedia:RPM Package Manager|rpm]])
 
! [[wikipedia:Haiku (operating system)|Haiku]]
 
! [[wikipedia:Solaris (operating system)|Solaris]] ([[wikipedia:32-bit|x86]])
 
! [[wikipedia:Solaris (operating system)|Solaris]] ([[wikipedia:64-bit|x64]])
 
! [[wikipedia:Solaris (operating system)|Solaris]] ([[wikipedia:SPARC|SPARC]])
 
! [[wikipedia:Solaris (operating system)|Solaris]] ([[wikipedia:PowerPC|PowerPC]])
 
|-
 
| [[DMG Decrypter]]
 
| [[User:MCTD81|MCTD81]]
 
| None
 
| None
 
| [[wikipedia:Graphical user interface|GUI]]
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{yes|[http://dmgdecrypter.blogspot.com/ DMG Decrypter Blog]}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
|-
 
| [[iDecrypt]]
 
| phoenix12045
 
| [[Maybach Dev Team]] member [https://twitter.com/phoenix12045 phoenix12045]
 
| None
 
| [[wikipedia:Graphical user interface|GUI]]
 
| {{yes|[http://www.fileden.com/files/2010/8/15/2942501/iDecrypt-1-0-phoenix12045.rar FileDen HTTP]<br />[http://www.mediafire.com/?71gpqjkn2sxi6nd MediaFire HTTP]}}
 
| {{partial|Use 32-bit version.}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
|-
 
| [[iDecrypter]]
 
| [[User:Fallensn0w|Fallensn0w]]
 
| VFDecrypt
 
| [http://github.com/fallensn0w/iDecrypter fallensn0w's iDecrypter]
 
| [[wikipedia:Graphical user interface|GUI]]
 
| {{yes|[http://github.com/Fallensn0w/iDecrypter/raw/master/bin/vfdecrypt.exe GitHub HTTP]}}
 
| {{partial|Use 32-bit version.}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
|-
 
| VFDecrypt
 
| Unknown
 
| [http://lorenzo.yellowspace.net/corrupt-sparseimage.html http://lorenzo.yellowspace.net/corrupt-sparseimage.html]
 
| [http://github.com/dra1nerdrake/VFDecrypt dra1nerdrake's VFDecrypt]
 
| [[wikipedia:Command-line interface|CLI]]
 
| {{yes|[http://iphoneelite.googlecode.com/files/vfdecrypt.zip Google Code HTTP]}}
 
| {{partial|Use 32-bit version.}}
 
| {{yes|[http://rgov.org/files/vfdecrypt-mac.zip RGov.org HTTP]}}
 
| {{yes|[http://lorenzo.yellowspace.net/vfdecrypt-binary-mactel.tgz YellowSpace HTTP]}}
 
| {{yes|[http://lorenzo.yellowspace.net/vfdecrypt-binary-ppc.tgz YellowSpace HTTP]}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
| {{no}}
 
|}
 
   
  +
To find the keys, you can either use the methods on [[AES Keys]] or the easier option for OS X, [[keylimepie]].
== Firmwares ==
 
{| border="1" cellspacing="0"
 
|-
 
|
 
! 1.x
 
! 2.x
 
! 3.x
 
! 4.x
 
|-
 
! Beta
 
|
 
| rowspan="2"| [[VFDecrypt Keys: 2.x|Keys]]
 
|[[VFDecrypt Keys: 3.x BETA|Keys]]
 
|[[VFDecrypt Keys: 4.x BETA|Keys]]
 
|-
 
|-
 
! Final
 
|[[VFDecrypt Keys: 1.x|Keys]]
 
|[[VFDecrypt Keys: 3.x|Keys]]
 
|[[VFDecrypt Keys: 4.x|Keys]]
 
|}
 
   
  +
== Decrypting ==
== All keys for Final Firmware versions ==
 
  +
{{main|Decrypting Firmwares}}
{| border="1" cellspacing="0"
 
  +
== Notes ==
|-
 
  +
Certain files share the same key and IV per [[Application Processor|application processor]] (per build) provided the devices have the same pixel resolution:
|
 
  +
* [[Update Ramdisk]]
! iPhone
 
  +
* [[Restore Ramdisk]]
! iPhone 3G
 
  +
* [[AppleLogo]]
! iPhone 3GS
 
  +
* [[BatteryCharging0]]
! iPhone 4
 
  +
* [[BatteryCharging1]]
! iPod touch
 
  +
* [[BatteryFull]]
! iPod touch 2G
 
  +
* [[BatteryLow0]]
! iPod touch 3G
 
  +
* [[BatteryLow1]]
! iPod touch 4G
 
  +
* [[GlyphCharging]]
! iPad
 
  +
* [[GlyphPlugin]]
! AppleTV 2G
 
  +
* [[Kernelcache]]
|-
 
  +
* [[NeedService]]
! 1.0
 
| [[Alpine 1A420]]
+
* [[RecoveryMode]]
  +
* [[SEP Firmware]]
| b
 
  +
* [[WTF]]
| c
 
  +
| d
 
  +
You can use [[img3decrypt]] or [[xpwntool]] to decrypt these files as described in [[Decrypting Firmwares]]. Once done, mount or extract using the tool of your choice.
| e
 
  +
| a
 
  +
The firmware version number for the [[List of Apple TVs|Apple TV]] builds are the ones that the Apple TV reports (also known as the "marketing version").
| b
 
  +
| c
 
  +
All dates are relative to [[wikipedia:Coordinated Universal Time|UTC]].
| d
 
  +
| e
 
  +
GID AES is used by iBoot to decrypt firmware images. When iBoot loads the kernelcache, GID AES is disabled. This means in order to get firmware keys, you must gain code execution in a setting where GID AES is still enabled. In most cases, this means exploiting iBoot itself, before the kernelcache is loaded.
|-
 
  +
! 1.0.0
 
  +
==Firmware Versions==
| Heavenly 1A543a
 
  +
{{see also|Prototypes}}
| b
 
  +
This is a full and comprehensive list of all firmwares Apple Inc. has made available to the public in some way, be it the [[Apple Developer|dev center]] or [[iTunes]]. This list also contains a few firmwares for which there never was an IPSW (as far as can be told) such as 4.2.5 for the [[N92AP|CDMA iPhone 4]] (iPhone3,3). These few builds came preinstalled on the device, but are not available for download.
| c
 
  +
| d
 
  +
* [[Firmware Keys/1.x|1.x]]
| e
 
  +
* [[Firmware Keys/2.x|2.x]]
| a
 
  +
* [[Firmware Keys/3.x|3.x]]
| b
 
  +
* [[Firmware Keys/4.x|4.x]]
| c
 
  +
* [[Firmware Keys/5.x|5.x]]
| d
 
  +
* [[Firmware Keys/6.x|6.x]]
| e
 
  +
* [[Firmware Keys/7.x|7.x]]
|-
 
  +
* [[Firmware Keys/8.x|8.x]]
! 1.0.1
 
  +
* [[Firmware Keys/9.x|9.x]]
| Heavenly 1C25
 
  +
* [[Firmware Keys/10.x|10.x]]
| b
 
  +
* [[Firmware Keys/11.x|11.x]]
| c
 
  +
* [[Firmware Keys/12.x|12.x]]
| d
 
  +
* [[Firmware Keys/13.x|13.x]]
| e
 
  +
* [[Firmware Keys/14.x|14.x]]
| a
 
  +
* [[Firmware Keys/15.x|15.x]]
| b
 
  +
* [[Firmware Keys/16.x|16.x]]
| c
 
| d
 
| e
 
|-
 
! 1.0.2
 
| Heavenly 1C28
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 1.1.1
 
| Snowbird 3A109a
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 1.1.2
 
| Oktoberfest 3B48b
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 1.1.3
 
| Little Bear 4A93
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 1.1.4
 
| Little Bear 4A102
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 2.0
 
| Big Bear 5A347
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 2.0.1
 
| Big Bear 5B108
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 2.0.2
 
| Big Bear 5C1
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 2.1
 
| Sugar Bowl 5F136
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 2.2
 
| Timberline 5G77
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 2.2.1
 
| SUTimberline 5H11
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 3.0
 
| [[Kirkwood 7A341 (iPhone)|Kirkwood 7A341]]
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 3.0.1
 
| [[Kirkwood 7A400 (iPhone)|Kirkwood 7A400]]
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 3.1
 
| [[Northstar 7C144 (iPhone)|Northstar 7C144]]
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 3.1.2
 
| [[Northstar 7D11 (iPhone)|Northstar 7D11]]
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 3.1.3
 
| [[SUNorthstarTwo 7E18 (iPhone)|SUNorthstarTwo 7E18]]
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 4.0
 
| no
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 4.0.1
 
| no
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 4.0.2
 
| no
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
! 4.1
 
| no
 
| b
 
| c
 
| d
 
| e
 
| a
 
| b
 
| c
 
| d
 
| e
 
|-
 
|}
 
   
 
== See also ==
 
== See also ==
  +
* [[Application Processor]]
* [[Firmware]] - a page with links to download the firmware images
 
   
[[Category:VFDecrypt]]
+
[[Category:Decryption]]

Latest revision as of 10:42, 6 June 2022

Firmware Keys are keys which decrypt bootloaders, ramdisks, and root filesystem of iOS firmware, if those components are encrypted. Apple uses encryption to make it harder to analyze and modify them. Over time Apple changed the way they encrypt firmware files, hence the way to decrypt them and get decryption keys changed as well.

History

With the release of the iPhone came the IMG2 file format. They were used on all known iPhone OS 1.x firmwares. For the 1.1.x series, they were encrypted with the 0x837 key. The discovery of the 0x837 key led to the ability to decrypt any 1.x firmware.

Following IMG2 came the IMG3 file format. They were introduced with iPhone OS 2.0 beta 4, and have been in use ever since. In order to maintain their integrity, they use multiple layers of encryption. Apple took encryption seriously with IMG3 by utilizing AES (based on the Rinjndael key schedule). In terms of the pre-iPhone OS 3 VFDecrypt key, it is stored as plain-text in the "__restore" segment of the ASR image within the ramdisks.

The ramdisk keys can only be retrieved with the processor specific GID Key. The GID key is currently unretrievable and can only be utilized through the built-in AES engine. To complicate things even more, the engine is only accessible through a special bootrom or iBoot exploit (jailbreaks typically expose it with /dev/aes_0). This makes usage of the key nearly impossible.

However, once you have access to the AES engine, the entire system falls apart. You are able to upload an encrypted ramdisk and grab the decryption keys for it. Once you manage to decrypt the ramdisk, you can run it through GenPass to decrypt the firmware key.

To find the keys, you can either use the methods on AES Keys or the easier option for OS X, keylimepie.

Decrypting

Main article: Decrypting Firmwares

Notes

Certain files share the same key and IV per application processor (per build) provided the devices have the same pixel resolution:

You can use img3decrypt or xpwntool to decrypt these files as described in Decrypting Firmwares. Once done, mount or extract using the tool of your choice.

The firmware version number for the Apple TV builds are the ones that the Apple TV reports (also known as the "marketing version").

All dates are relative to UTC.

GID AES is used by iBoot to decrypt firmware images. When iBoot loads the kernelcache, GID AES is disabled. This means in order to get firmware keys, you must gain code execution in a setting where GID AES is still enabled. In most cases, this means exploiting iBoot itself, before the kernelcache is loaded.

Firmware Versions

See also: Prototypes

This is a full and comprehensive list of all firmwares Apple Inc. has made available to the public in some way, be it the dev center or iTunes. This list also contains a few firmwares for which there never was an IPSW (as far as can be told) such as 4.2.5 for the CDMA iPhone 4 (iPhone3,3). These few builds came preinstalled on the device, but are not available for download.

See also