<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.theiphonewiki.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dogbert</id>
	<title>The iPhone Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.theiphonewiki.com/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dogbert"/>
	<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/wiki/Special:Contributions/Dogbert"/>
	<updated>2026-07-30T11:55:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=25523</id>
		<title>Baseband Commands</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_Commands&amp;diff=25523"/>
		<updated>2012-04-29T19:51:26Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Setting up Minicom 2.2 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==About==&lt;br /&gt;
In this page, you'll find some Baseband Commands. You can use them with Minicom 2.2, that can be found on Cydia.&lt;br /&gt;
&lt;br /&gt;
==Setting up Minicom 2.2==&lt;br /&gt;
# After installing Minicom from Cydia, make sure the folder [[:/usr/etc]] exists. SSH into your iPhone and then, type: ''minicom -s''.&lt;br /&gt;
# Now, select ''Serial Port Setup'' in the Menu and press Enter. Then, press &amp;quot;a&amp;quot; and set Serial Device to ''[[:/dev/tty.debug]]'' (however, ''[[:/dev/dlci.spi-baseband.extra_13]]'' or ''[[:/dev/dlci.spi-baseband.extra_0]]'' also works and appears to be more reliable than the other device).&lt;br /&gt;
# Press Esc, and in the Main Menu, select ''Save setup as dfl''. Now, select &amp;quot;exit&amp;quot;.&lt;br /&gt;
# To run minicom using ssh, just run ''minicom -w''&lt;br /&gt;
&lt;br /&gt;
==Running Minicom 2.2 from MobileTerminal==&lt;br /&gt;
'''Note''': minicom does work on MobileTerminal only on root (use su) and only after it has been configured (through the steps above).&lt;br /&gt;
# Open [[MobileTerminal.app]].&lt;br /&gt;
# Run the command su, enter your root password (default alpine) and then run ''minicom -w''.&lt;br /&gt;
# To exit minicom, slide your finger on the screen (&amp;quot;gesture&amp;quot;) to the bottom right (if you haven't changed this setting in MobileTerminal settings), then press A, X and enter.&lt;br /&gt;
&lt;br /&gt;
==How to run Baseband Commands==&lt;br /&gt;
First, run Minicom. Then, type &amp;quot;at&amp;quot; and press Enter. Then, you can type the command that you want, have fun.&lt;br /&gt;
&lt;br /&gt;
==Baseband Commands==&lt;br /&gt;
{{main|List of baseband commands}}.&lt;br /&gt;
&lt;br /&gt;
===Getting Information===&lt;br /&gt;
* '''at+xgendata''': Display some baseband informations&lt;br /&gt;
* '''at&amp;amp;v''': Display the profiles in the Baseband (Active Profile, Stored Profile 0 and Stored Profile 1)&lt;br /&gt;
* '''at+clac''': Show some baseband commands&lt;br /&gt;
* '''at&amp;amp;h''': Show more Baseband Commands&lt;br /&gt;
* '''at+cgsn''': Show serial number from BBUpdaterExtreme&lt;br /&gt;
* '''at+xdrv=9,3''': Command from BBUpdaterExtreme&lt;br /&gt;
* '''at+cpwroff''': Powercycle baseband modem from BBUpdaterExtreme&lt;br /&gt;
* '''at+csq''': Get signal strength from BBUpdaterExtreme&lt;br /&gt;
&lt;br /&gt;
===Unlock===&lt;br /&gt;
* '''at+clck''': Traditional unlock command&lt;br /&gt;
* '''at+xlock''': Wildcard unlock&lt;br /&gt;
* '''at+xsimstate''': Print lock state (write at+xsimstate=1 to turn on, at+xsimstate=0 to turn off)&lt;br /&gt;
&lt;br /&gt;
===SMS===&lt;br /&gt;
* '''at+cmgf''': SMS operating mode (at+cmgf=0 - PDU, at+cmgf=1 - text)&lt;br /&gt;
* '''at+cmgs''': Send SMS (write at+cmgs=&amp;quot;[PHONE NUMBER]&amp;quot;[ENTER][MESSAGE][CTRL-Z] while [ENTER] is an enter (\r\n) and [CTRL-Z] is ASCII 26)&lt;br /&gt;
&lt;br /&gt;
===General===&lt;br /&gt;
* '''atz''': Reset modem&lt;br /&gt;
* '''ath''': Hangup modem&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25522</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25522"/>
		<updated>2012-04-29T19:51:00Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Hardware Thumbprint Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 // return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A) {&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx, [[NORID|dep1_norid]], 0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx, [[CHIPID|dep2_chipid]], 0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A, (u8*)ctx.Message_Digest, 0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK, u8 *norid, u8 *chipid, u8 *keyB) {&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 &lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in, u8 *key, u8 *iv, u8 *out, u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2], nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in, tmpin, (u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea, (u32*)out, (u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea, (u32*)out_iv, (u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {&lt;br /&gt;
 	0x03, 0x5E, 0x20, 0x03,&lt;br /&gt;
 	0xA9, 0x74, 0xFC, 0x57,&lt;br /&gt;
 	0xBB, 0x2D, 0x59, 0x28,&lt;br /&gt;
 	0xBF, 0x10, 0xAE, 0xB9,&lt;br /&gt;
 	0x00, 0x00, 0x00, 0x00&lt;br /&gt;
 };&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx, [[CHIPID|chipid]], 16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx, [[NORID|norid]], 16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx, imei, 16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx, salt, 20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP, (u8*)ctx.Message_Digest, 0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Apple calls this &amp;quot;BasebandThumbprint&amp;quot;. It can be obtained from the baseband serial port with [[Baseband Commands|at+xthumb?]].&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey) {&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx, hwTP, 20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx, salt, 20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey, (u8*)ctx.Message_Digest, 0x14);&lt;br /&gt;
 }&lt;br /&gt;
This generates the key which can be used to encrypt/decrypt the wildcard ticket - the [[CHIPID|chipID]]/[[NORID|norID]] are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25488</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25488"/>
		<updated>2012-04-22T22:07:59Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Hardware Thumbprint Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|dep1_norid]],0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|dep2_chipid]],0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|chipid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|norid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
Apple calls this &amp;quot;BasebandThumbprint&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25487</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25487"/>
		<updated>2012-04-22T22:07:49Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Hardware Thumbprint Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|dep1_norid]],0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|dep2_chipid]],0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|chipid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|norid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 Apple calls this &amp;quot;BasebandThumbprint&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25486</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25486"/>
		<updated>2012-04-22T22:07:40Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Wildcard Ticket Key Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|dep1_norid]],0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|dep2_chipid]],0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|chipid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|norid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25485</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=25485"/>
		<updated>2012-04-22T21:57:13Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Wildcard Ticket Key Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|dep1_norid]],0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|dep2_chipid]],0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|chipid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|norid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required. Apple calls this &amp;quot;BasebandThumbprint&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=17078</id>
		<title>Talk:WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=17078"/>
		<updated>2011-03-28T19:51:57Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theoretically, can't we just edit the .plist? and make it into the factory unlocked IMSI Mask? -- {{unsigned|Leobruh|5:32, 19 August 2010 (UTC)}}&lt;br /&gt;
&lt;br /&gt;
:The activation plist is signed, so to do this you require a jailbreak anyway. --[[User:Lilstevie|Lilstevie]] 09:45, 20 August 2010 (UTC)- lilstevie&lt;br /&gt;
&lt;br /&gt;
i realize that. but wouldnt this result in a permanent unlock? [[User:Leobruh|Leobruh]] 07:37, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
I'm guessing the ticket is handled by the baseband, which requires an exploit to get unsigned code running in the first place? [[User:Iemit737|Iemit737]] 07:41, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
The wildcard ticket is also signed - simple edits break the signature and the ticket gets rejected then. rtfm cryptography 101. [[User:dogbert|dogbert]] 16:02, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
kay but unsigned code already runs when the phone is jailbroken and has access to the filesystem. wouldnt editing the .plist be okay since the sig checks arent needed. again this is all theoretical. im jw [[User:Leobruh|Leobruh]] 18:33, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
The baseband processor checks the signature, not the application processor. [[User:dogbert|dogbert]] 18:36, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
ahh got ya! but would my theory work though through an exploit such as AT+XAPP? instead of a payload it just changes the .plist? [[User:Leobruh|Leobruh]] 00:15, 20 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
:you would still require the valid NCK for it to process the unlock in that method, the current way the payloads work for exploits in the baseband processor are adequate --[[User:Lilstevie|Lilstevie]] 09:44, 20 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:i thought NKC was only for the iPhone 2G? 0.o [[User:Leobruh|Leobruh]] 14:47, 21 August 2010 (UTC)!&lt;br /&gt;
::NCK or Network Code Key is on any cellular device that gets locked to a carrier --[[User:Lilstevie|Lilstevie]] 14:52, 19 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is there are ability to decode WildcardTicket received from Apple to see NCK or lockstate table?&lt;br /&gt;
What about unlocked by request to carrier iPhones? Is it some differences in WildcardTicket? --[[User:Requilence|Requilence]] 13:17, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Decrypting is possible since the key is known. Changing the ticket is, however, not possible since it breaks the signatures. For carrier unlocked phones, Apple sends a new WildcardTicket without a lock table during sync.--[[User:Dogbert|Dogbert]] 16:43, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Tell me this, if the signature is broken, what happens to the phone? DFU, Recovery...? [[User:Leobruh|Leobruh]] 17:41, 20 March 2011 (UTC)!&lt;br /&gt;
&lt;br /&gt;
:::The ticket is rejected and the baseband stays unactivated, e.g. locked.--[[User:Dogbert|Dogbert]] 22:20, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Apple send it to iphone only on sync after activate? I try SAM on unlocked by request iphone, it's activate properly with right IMSI and IMEI, but seems like WildcardTicket doesn't have  lock table accept any IMSI. How can i check this? --[[User:Requilence|Requilence]] 19:52, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::Just decrypt the activation ticket and check the tables. All the information is given in the wiki, you just have to piece it together on your own.--[[User:Dogbert|Dogbert]] 22:20, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
How do you decrypt it? And wait does apple send it on sync or on activation? For instance, if I had a locked iPhone at activation, and called my carrier to get it unlocked then sync it, would apple issue a new wildcardticket unlocking it without deactivating? Or tell me to restore and deactivate?&lt;br /&gt;
:The decryption is implicitly described on various pages of this wiki (TEA in CBC with a pre-salted key).  When your iPhone becomes unlock, Apple will issue a new WildcardTicket during sync so a restore is unnecessary. --[[User:Dogbert|Dogbert]] 19:51, 28 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=NCK&amp;diff=16950</id>
		<title>NCK</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=NCK&amp;diff=16950"/>
		<updated>2011-03-21T02:31:58Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Abbreviation of '''N'''etwork '''C'''ontrol '''K'''ey. The NCK is a 15-digit key required to &amp;quot;legitimately&amp;quot; [[unlock]] the [[M68ap|iPhone 2G]]. The mechanism to unlock the phone with a valid NCK is still present and usable in [[X-Gold 608]] and presumably [[X-Gold 618|later]] basebands. It is, however, superseded by the policies set in the [[WildcardTicket]] that is generated during the activation process. An unlocked phone receives a wildcard ticket that has no restrictions set.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=NCK&amp;diff=16949</id>
		<title>NCK</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=NCK&amp;diff=16949"/>
		<updated>2011-03-21T02:31:45Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Abreviation of '''N'''etwork '''C'''ontrol '''K'''ey. The NCK is a 15-digit key required to &amp;quot;legitimately&amp;quot; [[unlock]] the [[M68ap|iPhone 2G]]. The mechanism to unlock the phone with a valid NCK is still present and usable in [[X-Gold 608]] and presumably [[X-Gold 618|later]] basebands. It is, however, superseded by the policies set in the [[WildcardTicket]] that is generated during the activation process. An unlocked phone receives a wildcard ticket that has no restrictions set.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=NCK&amp;diff=16948</id>
		<title>NCK</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=NCK&amp;diff=16948"/>
		<updated>2011-03-21T02:24:44Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: Reverting edit for factual incorrectness.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Abreviation of '''N'''etwork '''C'''ontrol '''K'''ey. The NCK is a 15-digit key required to &amp;quot;legitimately&amp;quot; [[unlock]] the [[M68ap|iPhone 2G]]. Every other [[iPhone]] revision is unlocked with a [[WildcardTicket]] which permits every [[wikipedia:Mobile Network Code|MNC]]/[[wikipedia:Mobile Country Code|MCC]]/[[wikipedia:ICCID|ICCID]] combination. &lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=16938</id>
		<title>Talk:WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=16938"/>
		<updated>2011-03-20T22:20:27Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theoretically, can't we just edit the .plist? and make it into the factory unlocked IMSI Mask? -- {{unsigned|Leobruh|5:32, 19 August 2010 (UTC)}}&lt;br /&gt;
&lt;br /&gt;
:The activation plist is signed, so to do this you require a jailbreak anyway. --[[User:Lilstevie|Lilstevie]] 09:45, 20 August 2010 (UTC)- lilstevie&lt;br /&gt;
&lt;br /&gt;
i realize that. but wouldnt this result in a permanent unlock? [[User:Leobruh|Leobruh]] 07:37, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
I'm guessing the ticket is handled by the baseband, which requires an exploit to get unsigned code running in the first place? [[User:Iemit737|Iemit737]] 07:41, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
The wildcard ticket is also signed - simple edits break the signature and the ticket gets rejected then. rtfm cryptography 101. [[User:dogbert|dogbert]] 16:02, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
kay but unsigned code already runs when the phone is jailbroken and has access to the filesystem. wouldnt editing the .plist be okay since the sig checks arent needed. again this is all theoretical. im jw [[User:Leobruh|Leobruh]] 18:33, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
The baseband processor checks the signature, not the application processor. [[User:dogbert|dogbert]] 18:36, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
ahh got ya! but would my theory work though through an exploit such as AT+XAPP? instead of a payload it just changes the .plist? [[User:Leobruh|Leobruh]] 00:15, 20 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
:you would still require the valid NCK for it to process the unlock in that method, the current way the payloads work for exploits in the baseband processor are adequate --[[User:Lilstevie|Lilstevie]] 09:44, 20 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:i thought NKC was only for the iPhone 2G? 0.o [[User:Leobruh|Leobruh]] 14:47, 21 August 2010 (UTC)!&lt;br /&gt;
::NCK or Network Code Key is on any cellular device that gets locked to a carrier --[[User:Lilstevie|Lilstevie]] 14:52, 19 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is there are ability to decode WildcardTicket received from Apple to see NCK or lockstate table?&lt;br /&gt;
What about unlocked by request to carrier iPhones? Is it some differences in WildcardTicket? --[[User:Requilence|Requilence]] 13:17, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Decrypting is possible since the key is known. Changing the ticket is, however, not possible since it breaks the signatures. For carrier unlocked phones, Apple sends a new WildcardTicket without a lock table during sync.--[[User:Dogbert|Dogbert]] 16:43, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
::Tell me this, if the signature is broken, what happens to the phone? DFU, Recovery...? [[User:Leobruh|Leobruh]] 17:41, 20 March 2011 (UTC)!&lt;br /&gt;
&lt;br /&gt;
:::The ticket is rejected and the baseband stays unactivated, e.g. locked.--[[User:Dogbert|Dogbert]] 22:20, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:: Apple send it to iphone only on sync after activate? I try SAM on unlocked by request iphone, it's activate properly with right IMSI and IMEI, but seems like WildcardTicket doesn't have  lock table accept any IMSI. How can i check this? --[[User:Requilence|Requilence]] 19:52, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:::Just decrypt the activation ticket and check the tables. All the information is given in the wiki, you just have to piece it together on your own.--[[User:Dogbert|Dogbert]] 22:20, 20 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=16934</id>
		<title>Talk:WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=16934"/>
		<updated>2011-03-20T16:43:23Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theoretically, can't we just edit the .plist? and make it into the factory unlocked IMSI Mask? -- {{unsigned|Leobruh|5:32, 19 August 2010 (UTC)}}&lt;br /&gt;
&lt;br /&gt;
:The activation plist is signed, so to do this you require a jailbreak anyway. --[[User:Lilstevie|Lilstevie]] 09:45, 20 August 2010 (UTC)- lilstevie&lt;br /&gt;
&lt;br /&gt;
i realize that. but wouldnt this result in a permanent unlock? [[User:Leobruh|Leobruh]] 07:37, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
I'm guessing the ticket is handled by the baseband, which requires an exploit to get unsigned code running in the first place? [[User:Iemit737|Iemit737]] 07:41, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
The wildcard ticket is also signed - simple edits break the signature and the ticket gets rejected then. rtfm cryptography 101. [[User:dogbert|dogbert]] 16:02, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
kay but unsigned code already runs when the phone is jailbroken and has access to the filesystem. wouldnt editing the .plist be okay since the sig checks arent needed. again this is all theoretical. im jw [[User:Leobruh|Leobruh]] 18:33, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
The baseband processor checks the signature, not the application processor. [[User:dogbert|dogbert]] 18:36, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
ahh got ya! but would my theory work though through an exploit such as AT+XAPP? instead of a payload it just changes the .plist? [[User:Leobruh|Leobruh]] 00:15, 20 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
:you would still require the valid NCK for it to process the unlock in that method, the current way the payloads work for exploits in the baseband processor are adequate --[[User:Lilstevie|Lilstevie]] 09:44, 20 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:i thought NKC was only for the iPhone 2G? 0.o [[User:Leobruh|Leobruh]] 14:47, 21 August 2010 (UTC)!&lt;br /&gt;
::NCK or Network Code Key is on any cellular device that gets locked to a carrier --[[User:Lilstevie|Lilstevie]] 14:52, 19 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is there are ability to decode WildcardTicket received from Apple to see NCK or lockstate table?&lt;br /&gt;
What about unlocked by request to carrier iPhones? Is it some differences in WildcardTicket? --[[User:Requilence|Requilence]] 13:17, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Decrypting is possible since the key is known. Changing the ticket is, however, not possible since it breaks the signatures. For carrier unlocked phones, Apple sends a new WildcardTicket without a lock table during sync.--[[User:Dogbert|Dogbert]] 16:43, 20 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=16933</id>
		<title>Talk:WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=16933"/>
		<updated>2011-03-20T16:43:05Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theoretically, can't we just edit the .plist? and make it into the factory unlocked IMSI Mask? -- {{unsigned|Leobruh|5:32, 19 August 2010 (UTC)}}&lt;br /&gt;
&lt;br /&gt;
:The activation plist is signed, so to do this you require a jailbreak anyway. --[[User:Lilstevie|Lilstevie]] 09:45, 20 August 2010 (UTC)- lilstevie&lt;br /&gt;
&lt;br /&gt;
i realize that. but wouldnt this result in a permanent unlock? [[User:Leobruh|Leobruh]] 07:37, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
I'm guessing the ticket is handled by the baseband, which requires an exploit to get unsigned code running in the first place? [[User:Iemit737|Iemit737]] 07:41, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
The wildcard ticket is also signed - simple edits break the signature and the ticket gets rejected then. rtfm cryptography 101. [[User:dogbert|dogbert]] 16:02, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
kay but unsigned code already runs when the phone is jailbroken and has access to the filesystem. wouldnt editing the .plist be okay since the sig checks arent needed. again this is all theoretical. im jw [[User:Leobruh|Leobruh]] 18:33, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
The baseband processor checks the signature, not the application processor. [[User:dogbert|dogbert]] 18:36, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
ahh got ya! but would my theory work though through an exploit such as AT+XAPP? instead of a payload it just changes the .plist? [[User:Leobruh|Leobruh]] 00:15, 20 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
:you would still require the valid NCK for it to process the unlock in that method, the current way the payloads work for exploits in the baseband processor are adequate --[[User:Lilstevie|Lilstevie]] 09:44, 20 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
:i thought NKC was only for the iPhone 2G? 0.o [[User:Leobruh|Leobruh]] 14:47, 21 August 2010 (UTC)!&lt;br /&gt;
::NCK or Network Code Key is on any cellular device that gets locked to a carrier --[[User:Lilstevie|Lilstevie]] 14:52, 19 September 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
Is there are ability to decode WildcardTicket received from Apple to see NCK or lockstate table?&lt;br /&gt;
What about unlocked by request to carrier iPhones? Is it some differences in WildcardTicket? --[[User:Requilence|Requilence]] 13:17, 20 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
:Decrypting is possible since the key is known. Changing the ticket is, however, not possible since it breaks the signatures. For carrier unlocked phones, Apple sends a new WildcardTicket without a lock table during sync.&lt;br /&gt;
--[[User:Dogbert|Dogbert]] 16:43, 20 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=WildcardTicket&amp;diff=16926</id>
		<title>WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=WildcardTicket&amp;diff=16926"/>
		<updated>2011-03-20T03:28:37Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Ticket Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The wildcard ticket is used for activating the baseband. It is stored in the file &amp;quot;/var/root/Library/Lockdown/activation_records/wildcard_record.plist&amp;quot;. When activating an iPhone, the ticket is pulled from Apple's server and stored on the device. It contains all the information about sim-/netlocks. Factory- and carrier-unlocked devices receive a wildcard ticket with policies that permit all SIM cards.&lt;br /&gt;
&lt;br /&gt;
==Ticket Layout==&lt;br /&gt;
 0x0 Version number (=2 for iPhone 3G, 3GS)&lt;br /&gt;
 0x4 Encrypted Ticket&lt;br /&gt;
&lt;br /&gt;
The ticket is decrypted with [[TEA]] in [[CBC mode]] using a key hashed from the [[NORID]], [[CHIPID]], [[wikipedia:IMEI|IMEI]] and a [[wikipedia:Salt (cryptography)|salt]]. The layout of the decrypted ticket looks like this:&lt;br /&gt;
&lt;br /&gt;
 0x000        Certificate Length (in bits)&lt;br /&gt;
 0x004        Certificate Serial (usually 1)&lt;br /&gt;
 0x008        Public Key Length (in bits)&lt;br /&gt;
 0x00c        Public Key Exponent&lt;br /&gt;
 0x010-0x090  Public Key (RSA Key 3)&lt;br /&gt;
 0x090-0x110  Montgomery Reduction&lt;br /&gt;
 0x110-0x190  Certificate of the first 0x110 bytes signed with rsa_key2&lt;br /&gt;
 0x190-0x19B  [[wikipedia:ICCID|ICCID]] mask (relevant bits for simlock)&lt;br /&gt;
 0x19C-0x1A3  [[wikipedia:IMEI|IMEI]]&lt;br /&gt;
 0x1A4-0x1B7  [[Baseband TEA Keys#Hardware Thumbprint Generation|Hash of several hardware IDs]] ([[wikipedia:IMEI|IMEI]], [[NORID]], [[CHIPID]])&lt;br /&gt;
 0x1B8-...    Table of &amp;quot;policies&amp;quot; (netlock)&lt;br /&gt;
&lt;br /&gt;
Attached to the decrypted ticket is a certificate (0x80 byte) signed with the [[Baseband RSA Keys|RSA key 3]] at 0x010.&lt;br /&gt;
&lt;br /&gt;
==Policy Table Layout==&lt;br /&gt;
 0x0          Total length of the policy table in bytes&lt;br /&gt;
 &amp;lt;Policy Item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An item is 12 byte in size and has this structure:&lt;br /&gt;
 0x0-0x2      ID&lt;br /&gt;
 0x2-0x4      type?&lt;br /&gt;
 0x4-0xC      [[wikipedia:IMSI|IMSI]] mask&lt;br /&gt;
&lt;br /&gt;
Each [[wikipedia:nibble|nibble]] of a mask corresponds to a number - the wildcard is encoded as 0xE.&lt;br /&gt;
&lt;br /&gt;
===AT&amp;amp;T USA===&lt;br /&gt;
 IMSI Mask&lt;br /&gt;
 310150?????????&lt;br /&gt;
 310170?????????&lt;br /&gt;
 310410?????????&lt;br /&gt;
 311180?????????&lt;br /&gt;
 310980?????????&lt;br /&gt;
This is an iPhone 3GS from [[wikipedia:List of mobile network codes in the United States|AT&amp;amp;T]].&lt;br /&gt;
&lt;br /&gt;
===T-Mobile Germany===&lt;br /&gt;
 IMSI Mask&lt;br /&gt;
 26201??????????&lt;br /&gt;
 26201??????????&lt;br /&gt;
 26201??????????&lt;br /&gt;
This is an iPhone 3G from [[wikipedia:Mobile_network_code#G|T-Mobile Germany]].&lt;br /&gt;
&lt;br /&gt;
===Factory Unlocked Device===&lt;br /&gt;
 IMSI Mask&lt;br /&gt;
 ???????????????&lt;br /&gt;
Obligatory.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation&amp;diff=16901</id>
		<title>Activation</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation&amp;diff=16901"/>
		<updated>2011-03-18T20:32:44Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:foto.jpg|thumb|right|iPhone with 1 signal bar and damaged [[hacktivation]] or it doesn't have an internet connection|100px]]&lt;br /&gt;
&lt;br /&gt;
Activation is the process by which a new (or newly restored) iPhone or iPod touch can get by the &amp;quot;Emergency Call Screen&amp;quot; ([[iPhone]]) or &amp;quot;Connect to iTunes&amp;quot; screen (not to be confused with [[Recovery Mode]]; the activation screen has a battery icon in the top right corner to indicate this) to access the SpringBoard.&lt;br /&gt;
The code in charge of this resides in [[lockdownd]], which is always running on [[iOS]] and monitors the activation status of the device. Lockdownd patches (which requires a [[jailbreak]] whereby a patched kernel can be booted by [[iBoot]] without dynamic libraries dynamically patching in RAM) activate your phone and obviate the need to activate legitimately through [[iTunes]] with an official carrier however the iPhone cannot be used to communicate unless a [[unlock]] is found for the [[baseband]]. Lockdownd patches are only used on the [[iPhone]] as the [[iPod touch]] has never been denied activation regardless of firmware, country etc.&lt;br /&gt;
&lt;br /&gt;
Activation is handled by https://albert.apple.com/WebObjects/ALActivation.woa/wa/deviceActivation&lt;br /&gt;
&lt;br /&gt;
[[iTunes]] uses AMDeviceCopyValue on ActivationInfo to generate an [[Activation Token]] and sends it to Apple's activation server. Once the phone number provided in the [[Activation Token]] can be matched with the data in the [[Activation Token]], the server will generate a [[WildcardTicket]] and signs it with Apple's private key. [[iTunes]] then calls AMDeviceActivate with the [[WildcardTicket]]; The device gets the [[WildcardTicket]] and checks if the signature matches. If it does, it get pasts the emergency call screen and allowing the use of the iPhone. All devices actually go through this process. The activation process is outlined in detail in US patent no. [http://www.freepatentsonline.com/20090061934.pdf 2009/0061934].&lt;br /&gt;
&lt;br /&gt;
Although the [[iPod touch]] can be 'activated' without an internet connection, some services such as YouTube and Push Notifications will fail to work due to not having a valid authentication token ([http://support.apple.com/kb/TS3305 iPad and iPod touch: Unable to use YouTube or Push notifications]) so connecting to iTunes will activate the [[iPod Touch]] fully.&lt;br /&gt;
&lt;br /&gt;
The [[iPhone]] needs a cellular data connection for the first time, after the activation in [[iTunes]]. You can make calls if an alert says &amp;quot;iPhone is activated&amp;quot;. If you don't have a cellular data connection (3G, EDGE, GPRS) you won't be able to make calls and you have only 1 bar of reception. If you only have 1 bar and no carrier at the status bar, it isn't activated correctly.&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
* [http://www.freepatentsonline.com/20090061934.pdf Apple Patent]&lt;br /&gt;
&lt;br /&gt;
{{stub|iPhone}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=16900</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=16900"/>
		<updated>2011-03-18T18:29:25Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded cert in DER format)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature (SHA1+RSA) of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(GUID)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(Hash of hardware IDs)&amp;lt;string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(Hash of hardware IDs not directly used as a key - the TEA key can be derived from this)&amp;lt;string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(String ENUM &amp;quot;iPhone&amp;quot;, &amp;quot;iPod&amp;quot;, &amp;quot;iPod touch&amp;quot;, &amp;quot;iPad&amp;quot;)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(ICCID as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(IMEI as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(IMSI as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(String like &amp;quot;+1 (555) 555-5555&amp;quot;)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded binary GID1)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded binary GID2)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(ENUM kCTSIMSupportSIMStatusReady kCTSIMSupportSIMStatusNotReady kCTSIMSupportSIMStatusOperatorLocked)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(hex UUID)&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=16898</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=16898"/>
		<updated>2011-03-18T18:18:26Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout ActivationInfo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded cert in DER format)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature (SHA1+RSA) of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(GUID)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(Hash of hardware IDs not directly used as a key)&amp;lt;string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(String ENUM &amp;quot;iPhone&amp;quot;, &amp;quot;iPod&amp;quot;, &amp;quot;iPod touch&amp;quot;, &amp;quot;iPad&amp;quot;)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(ICCID as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(IMEI as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(IMSI as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(String like &amp;quot;+1 (555) 555-5555&amp;quot;)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded binary GID1)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded binary GID2)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(ENUM kCTSIMSupportSIMStatusReady kCTSIMSupportSIMStatusNotReady kCTSIMSupportSIMStatusOperatorLocked)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(hex UUID)&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=16897</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=16897"/>
		<updated>2011-03-18T18:18:00Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout ActivationInfo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded cert in DER format)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature (SHA1+RSA) of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(GUID)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(Hash of hardware IDs not directly used as a key)&amp;lt;string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(String ENUM &amp;quot;iPhone&amp;quot;, &amp;quot;iPod&amp;quot;, &amp;quot;iPod touch&amp;quot;, &amp;quot;iPad&amp;quot;)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(ICCID as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(IMEI as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(IMSI as base-10 string)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(String like &amp;quot;+1 (555) 555-5555&amp;quot;)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded binary GID1)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded binary GID2)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(ENUM kCTSIMSupportSIMStatusReady kCTSIMSupportSIMStatusNotReady kCTSIMSupportSIMStatusOperatorLocked)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(hex UUID)&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=16896</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=16896"/>
		<updated>2011-03-18T18:14:32Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Key A Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|dep1_norid]],0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|dep2_chipid]],0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|chipid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|norid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=16895</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=16895"/>
		<updated>2011-03-18T18:13:47Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Hardware Thumbprint Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep1_norid,0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep2_chipid,0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[CHIPID|chipid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,[[NORID|norid]],16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=CHIPID&amp;diff=16894</id>
		<title>CHIPID</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=CHIPID&amp;diff=16894"/>
		<updated>2011-03-18T18:12:18Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Each iPhone baseband has a unique CHIPID that is embedded in the iPhone baseband chip and unique to each phone. Its size is 96 bit (zero-padded to 128 bit).&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=NORID&amp;diff=16893</id>
		<title>NORID</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=NORID&amp;diff=16893"/>
		<updated>2011-03-18T18:11:10Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the hardware chip ID of the baseband [[wikipedia:Flash memory#NOR flash|NOR memory]] which contains both the [[Baseband Bootloader]] and [[Baseband Firmware|Firmware]]. Its size is 64 bit for the iPhone 3G baseband and 128 bit for the iPhone 3GS baseband. It's supposedly read-only data that has been burned in during production, e.g. it cannot be changed. The term NOR comes from [[wikipedia:NOR gate|&amp;quot;Not OR&amp;quot; gates]], which are used to create the flash memory.&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=User:Dogbert&amp;diff=16892</id>
		<title>User:Dogbert</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=User:Dogbert&amp;diff=16892"/>
		<updated>2011-03-18T17:55:57Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;out, out!! you demons of stupidity!!&lt;br /&gt;
&lt;br /&gt;
[[Special:Emailuser/Dogbert|email]] &lt;br /&gt;
&lt;br /&gt;
[http://dogber1.blogspot.com blag]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=User:Dogbert&amp;diff=16891</id>
		<title>User:Dogbert</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=User:Dogbert&amp;diff=16891"/>
		<updated>2011-03-18T17:54:34Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;out, out!! you demons of stupidity!!&lt;br /&gt;
&lt;br /&gt;
[[Special:Emailuser/Dogbert|Email]] [[http://dogber1.blogspot.com|Blag]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16890</id>
		<title>Talk:Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16890"/>
		<updated>2011-03-18T17:45:36Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Paul0]] suggested this factorization for rsa_key3:&lt;br /&gt;
&lt;br /&gt;
(not prime) f2  = &lt;br /&gt;
 24 95 0d 4a 72 24 f5 6a 15 5f 6f 58 e3 3b f9 92 &lt;br /&gt;
 c5 fb 21 5c bb 9d a3 8a 63 62 1c 91 90 89 f0 4a &lt;br /&gt;
 10 2e c8 86 17 78 13 0f a7 fd 73 31 aa f0 8c a3 &lt;br /&gt;
 63 88 e9 4d 51 d6 db cf 80 4e 6d df 12 f9 20 ab &lt;br /&gt;
 f9 d3 4a 17 b1 77 76 6c 9a fa 4a 62 5a dc b1 5e &lt;br /&gt;
 98 d3 3f 6e fa 24 ce ae ba 08 8c d8 c3 8c 1a ad &lt;br /&gt;
 e2 c2 bc cd c3 04 05 59 92 00 7d 8e 06 20 e5 de &lt;br /&gt;
 2f 11 f6 e0 7&lt;br /&gt;
&lt;br /&gt;
(not prime) f1 = &lt;br /&gt;
 20 f1 89 de ed 41 e6 df eb ea 2c 19 38 47 3b 29 &lt;br /&gt;
 25 bb 00 af 02 32 bd f5 52 31 de b9&lt;br /&gt;
&lt;br /&gt;
* Key3 = f1*f2. Please verify, thanks. yafu might be buggy&lt;br /&gt;
&lt;br /&gt;
However, &lt;br /&gt;
rsa_key3 = 112548145501143413877572720967635429059624128941235286814653432534119379263401954209730336088182279431822189480697279769933562374916693852799260561441848037943828221394563114427090483520789586156157496772821757538234969441211075232799607401426252155694386013902169784000266031008270047603255802707293989133031&lt;br /&gt;
&lt;br /&gt;
f2 = 17876955317115447381157919886144538387308441247085257635572171826794253277256372460463477770098763696910986285378300627539600204950194621383554975965324631149532355710525801309465604474665765254953825047369078348205584002973869012758851553079758612258254980441408089061867729556772&lt;br /&gt;
&lt;br /&gt;
f1 = 19574178722326421301599573536448352386098089397337991030176983150880&lt;br /&gt;
&lt;br /&gt;
f1*f2 = 349926718388261371569022220378917782692194588648747109479039236183507739374218762137974554503090374018744169165998671825504162527118702221137070525632386140758758095389408367984136132994861553048641125678600013365524850972617693473037042850155943617530837212223950368442328698913412086039290071192126386225277883345300427209227825789909214401759360&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; f1*f2 != rsa_key3 - the factorization is invalid. Moreover, f1 and f2 are even numbers and not prime. I suspect some confusion with the endianness of the hex key.&lt;br /&gt;
&lt;br /&gt;
--[[User:Dogbert|Dogbert]] 17:12, 18 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_RSA_Keys&amp;diff=16889</id>
		<title>Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_RSA_Keys&amp;diff=16889"/>
		<updated>2011-03-18T17:45:04Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: fix endianness&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the keys shared between the [[S-Gold 2]] and the [[X-Gold 608]]&lt;br /&gt;
&lt;br /&gt;
==Key 1==&lt;br /&gt;
This is used to validate the NCK token and decrypt secpack certificates.&lt;br /&gt;
&lt;br /&gt;
Modulus length 0x400 bits, Exponent 0x3&lt;br /&gt;
 0B 23 AE BA E3 75 7B 9D CE 44 58 8C CF 53 CC B0&lt;br /&gt;
 73 F9 06 57 64 37 A0 6C 68 F4 91 4E 7A 82 CB 6E&lt;br /&gt;
 12 CF FD 31 39 51 4C 06 C0 E9 CE A0 27 17 D6 95&lt;br /&gt;
 FB DF 94 26 B2 1C C1 73 24 06 E3 A8 C2 0F 5D A3&lt;br /&gt;
 41 6B D8 84 CB D0 EB 2E F9 DE 2F 21 78 DA C3 4D&lt;br /&gt;
 AF B9 BA D8 4B 7C 16 E2 CF 16 7A 1B 57 33 4F 26&lt;br /&gt;
 4D 53 26 FD 8E 38 B6 23 CE 5E B4 81 80 2B C0 FB&lt;br /&gt;
 9F 33 E1 3F 65 A2 49 C9 3F 08 6C 37 61 4B B7 C7&lt;br /&gt;
&lt;br /&gt;
==Key 2==&lt;br /&gt;
This is used to sign Key 3 in the [[WildcardTicket|wildcard ticket]] that is part of the [[activation token]].&lt;br /&gt;
&lt;br /&gt;
Modulus length 0x400 bits, Exponent 0x3&lt;br /&gt;
 05 BC 9F 4E 87 0C F9 A2 D8 DA 19 D8 14 82 B2 54&lt;br /&gt;
 3F 32 4D 08 0B AE 22 01 86 43 A1 0E 18 7A D1 F2&lt;br /&gt;
 4F CB 34 C6 10 C2 72 DB E3 B5 29 79 B2 80 34 E1&lt;br /&gt;
 4F A4 27 85 C5 04 57 4A 37 88 AD 9A 6B 57 C5 E0&lt;br /&gt;
 4F E5 89 80 1E ED AC 72 78 B1 73 05 FC 5E D1 3D&lt;br /&gt;
 46 9F 66 C4 B5 B4 4B 9E 87 8C 2E 3C BD 0C 15 AA&lt;br /&gt;
 D1 D5 57 71 00 D6 10 F7 96 E2 CF AC 60 53 57 C7&lt;br /&gt;
 65 AD 1D CB BC 5F 49 FD B5 ED EA B3 21 30 66 EA&lt;br /&gt;
&lt;br /&gt;
==Key 3==&lt;br /&gt;
This is used for signing in the [[WildcardTicket|wildcard ticket]]. The serial number is 1.&lt;br /&gt;
&lt;br /&gt;
Modulus length 0x400 bits, Exponent 0x3&lt;br /&gt;
 e7 5a 52 4b 14 94 fd 09 c6 6e d9 3f cc ce c8 88 &lt;br /&gt;
 89 43 b7 6e 8b b2 d9 05 b4 3d 58 a5 31 c3 19 cc &lt;br /&gt;
 11 e7 09 ff b4 be 26 2e 82 20 62 76 d5 96 ed 76 &lt;br /&gt;
 b7 10 77 22 64 09 ef 6d b8 cc 2c fb 5d 68 5b d1 &lt;br /&gt;
 a3 64 15 61 6c 3d df 32 04 2c 8e 7d 15 6d 9f e0 &lt;br /&gt;
 68 9a 5e 9e c8 67 d6 c2 c3 03 65 fd 4b b8 49 ab &lt;br /&gt;
 ca c4 f5 94 9d 4b 91 53 2b 68 be 7b 68 56 95 92 &lt;br /&gt;
 3a 8e 89 fa 77 76 38 17 b0 90 0f df f3 1c 46 a0 &lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16888</id>
		<title>Talk:Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16888"/>
		<updated>2011-03-18T17:20:24Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Paul0]] suggested this factorization for rsa_key3:&lt;br /&gt;
&lt;br /&gt;
(not prime) f2  = &lt;br /&gt;
 24 95 0d 4a 72 24 f5 6a 15 5f 6f 58 e3 3b f9 92 &lt;br /&gt;
 c5 fb 21 5c bb 9d a3 8a 63 62 1c 91 90 89 f0 4a &lt;br /&gt;
 10 2e c8 86 17 78 13 0f a7 fd 73 31 aa f0 8c a3 &lt;br /&gt;
 63 88 e9 4d 51 d6 db cf 80 4e 6d df 12 f9 20 ab &lt;br /&gt;
 f9 d3 4a 17 b1 77 76 6c 9a fa 4a 62 5a dc b1 5e &lt;br /&gt;
 98 d3 3f 6e fa 24 ce ae ba 08 8c d8 c3 8c 1a ad &lt;br /&gt;
 e2 c2 bc cd c3 04 05 59 92 00 7d 8e 06 20 e5 de &lt;br /&gt;
 2f 11 f6 e0 7&lt;br /&gt;
&lt;br /&gt;
(not prime) f1 = &lt;br /&gt;
 20 f1 89 de ed 41 e6 df eb ea 2c 19 38 47 3b 29 &lt;br /&gt;
 25 bb 00 af 02 32 bd f5 52 31 de b9&lt;br /&gt;
&lt;br /&gt;
* Key3 = f1*f2. Please verify, thanks. yafu might be buggy&lt;br /&gt;
&lt;br /&gt;
However, &lt;br /&gt;
rsa_key3 = 3723831821883702670678201674717918174629677902801569278439133496127413091410975376899192815194880111741267989023834018905027460993096578420421399938130915013991830265235766488560948787045449571744218241649175170290402111788993338128284057787949145302879517838138041196804337537028831470042894492396009634808062527953671468669060509014833090941515&lt;br /&gt;
&lt;br /&gt;
f2 = 17876955317115447381157919886144538387308441247085257635572171826794253277256372460463477770098763696910986285378300627539600204950194621383554975965324631149532355710525801309465604474665765254953825047369078348205584002973869012758851553079758612258254980441408089061867729556772&lt;br /&gt;
&lt;br /&gt;
f1 = 19574178722326421301599573536448352386098089397337991030176983150880&lt;br /&gt;
&lt;br /&gt;
f1*f2 = 349926718388261371569022220378917782692194588648747109479039236183507739374218762137974554503090374018744169165998671825504162527118702221137070525632386140758758095389408367984136132994861553048641125678600013365524850972617693473037042850155943617530837212223950368442328698913412086039290071192126386225277883345300427209227825789909214401759360&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; f1*f2 != rsa_key3 - the factorization is invalid. Moreover, f1 and f2 are even numbers and not prime. I suspect some confusion with the endianness of the hex key.&lt;br /&gt;
&lt;br /&gt;
--[[User:Dogbert|Dogbert]] 17:12, 18 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16887</id>
		<title>Talk:Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16887"/>
		<updated>2011-03-18T17:19:01Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Paul0]] suggested this factorization for rsa_key3:&lt;br /&gt;
&lt;br /&gt;
(not prime) f2  = &lt;br /&gt;
 24 95 0d 4a 72 24 f5 6a 15 5f 6f 58 e3 3b f9 92 &lt;br /&gt;
 c5 fb 21 5c bb 9d a3 8a 63 62 1c 91 90 89 f0 4a &lt;br /&gt;
 10 2e c8 86 17 78 13 0f a7 fd 73 31 aa f0 8c a3 &lt;br /&gt;
 63 88 e9 4d 51 d6 db cf 80 4e 6d df 12 f9 20 ab &lt;br /&gt;
 f9 d3 4a 17 b1 77 76 6c 9a fa 4a 62 5a dc b1 5e &lt;br /&gt;
 98 d3 3f 6e fa 24 ce ae ba 08 8c d8 c3 8c 1a ad &lt;br /&gt;
 e2 c2 bc cd c3 04 05 59 92 00 7d 8e 06 20 e5 de &lt;br /&gt;
 2f 11 f6 e0 7&lt;br /&gt;
&lt;br /&gt;
(not prime) f1 = &lt;br /&gt;
 20 f1 89 de ed 41 e6 df eb ea 2c 19 38 47 3b 29 &lt;br /&gt;
 25 bb 00 af 02 32 bd f5 52 31 de b9&lt;br /&gt;
&lt;br /&gt;
* Key3 = f1*f2. Please verify, thanks. yafu might be buggy&lt;br /&gt;
&lt;br /&gt;
However, &lt;br /&gt;
rsa_key3 = 3723831821883702670678201674717918174629677902801569278439133496127413091410975376899192815194880111741267989023834018905027460993096578420421399938130915013991830265235766488560948787045449571744218241649175170290402111788993338128284057787949145302879517838138041196804337537028831470042894492396009634808062527953671468669060509014833090941515&lt;br /&gt;
&lt;br /&gt;
f2 = 17876955317115447381157919886144538387308441247085257635572171826794253277256372460463477770098763696910986285378300627539600204950194621383554975965324631149532355710525801309465604474665765254953825047369078348205584002973869012758851553079758612258254980441408089061867729556772&lt;br /&gt;
&lt;br /&gt;
f1 = 19574178722326421301599573536448352386098089397337991030176983150880&lt;br /&gt;
&lt;br /&gt;
f1*f2 = 349926718388261371569022220378917782692194588648747109479039236183507739374218762137974554503090374018744169165998671825504162527118702221137070525632386140758758095389408367984136132994861553048641125678600013365524850972617693473037042850155943617530837212223950368442328698913412086039290071192126386225277883345300427209227825789909214401759360&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; f1*f2 != rsa_key3 - the factorization is invalid.&lt;br /&gt;
&lt;br /&gt;
--[[User:Dogbert|Dogbert]] 17:12, 18 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16886</id>
		<title>Talk:Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16886"/>
		<updated>2011-03-18T17:12:40Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Paul0]] suggested this factorization for rsa_key3:&lt;br /&gt;
&lt;br /&gt;
(not prime) f2  = &lt;br /&gt;
 24 95 0d 4a 72 24 f5 6a 15 5f 6f 58 e3 3b f9 92 &lt;br /&gt;
 c5 fb 21 5c bb 9d a3 8a 63 62 1c 91 90 89 f0 4a &lt;br /&gt;
 10 2e c8 86 17 78 13 0f a7 fd 73 31 aa f0 8c a3 &lt;br /&gt;
 63 88 e9 4d 51 d6 db cf 80 4e 6d df 12 f9 20 ab &lt;br /&gt;
 f9 d3 4a 17 b1 77 76 6c 9a fa 4a 62 5a dc b1 5e &lt;br /&gt;
 98 d3 3f 6e fa 24 ce ae ba 08 8c d8 c3 8c 1a ad &lt;br /&gt;
 e2 c2 bc cd c3 04 05 59 92 00 7d 8e 06 20 e5 de &lt;br /&gt;
 2f 11 f6 e0 7&lt;br /&gt;
&lt;br /&gt;
(not prime) f1 = &lt;br /&gt;
 20 f1 89 de ed 41 e6 df eb ea 2c 19 38 47 3b 29 &lt;br /&gt;
 25 bb 00 af 02 32 bd f5 52 31 de b9&lt;br /&gt;
&lt;br /&gt;
* Key3 = f1*f2. Please verify, thanks. yafu might be buggy&lt;br /&gt;
&lt;br /&gt;
However, &lt;br /&gt;
rsa_key3 = 3723831821883702670678201674717918174629677902801569278439133496127413091410975376899192815194880111741267989023834018905027460993096578420421399938130915013991830265235766488560948787045449571744218241649175170290402111788993338128284057787949145302879517838138041196804337537028831470042894492396009634808062527953671468669060509014833090941515&lt;br /&gt;
&lt;br /&gt;
f1 = 17876955317115447381157919886144538387308441247085257635572171826794253277256372460463477770098763696910986285378300627539600204950194621383554975965324631149532355710525801309465604474665765254953825047369078348205584002973869012758851553079758612258254980441408089061867729556772&lt;br /&gt;
&lt;br /&gt;
f2 = 19574178722326421301599573536448352386098089397337991030176983150880&lt;br /&gt;
&lt;br /&gt;
f1*f2 = 349926718388261371569022220378917782692194588648747109479039236183507739374218762137974554503090374018744169165998671825504162527118702221137070525632386140758758095389408367984136132994861553048641125678600013365524850972617693473037042850155943617530837212223950368442328698913412086039290071192126386225277883345300427209227825789909214401759360&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; f1*f2 != rsa_key3 - the factorization is invalid.&lt;br /&gt;
&lt;br /&gt;
--[[User:Dogbert|Dogbert]] 17:12, 18 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16885</id>
		<title>Talk:Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:Baseband_RSA_Keys&amp;diff=16885"/>
		<updated>2011-03-18T17:12:22Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: New page: User:Paul0 suggested this factorization for rsa_key3:  (not prime) f2  =   24 95 0d 4a 72 24 f5 6a 15 5f 6f 58 e3 3b f9 92   c5 fb 21 5c bb 9d a3 8a 63 62 1c 91 90 89 f0 4a   10 2e c8 ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[User:Paul0]] suggested this factorization for rsa_key3:&lt;br /&gt;
&lt;br /&gt;
(not prime) f2  = &lt;br /&gt;
 24 95 0d 4a 72 24 f5 6a 15 5f 6f 58 e3 3b f9 92 &lt;br /&gt;
 c5 fb 21 5c bb 9d a3 8a 63 62 1c 91 90 89 f0 4a &lt;br /&gt;
 10 2e c8 86 17 78 13 0f a7 fd 73 31 aa f0 8c a3 &lt;br /&gt;
 63 88 e9 4d 51 d6 db cf 80 4e 6d df 12 f9 20 ab &lt;br /&gt;
 f9 d3 4a 17 b1 77 76 6c 9a fa 4a 62 5a dc b1 5e &lt;br /&gt;
 98 d3 3f 6e fa 24 ce ae ba 08 8c d8 c3 8c 1a ad &lt;br /&gt;
 e2 c2 bc cd c3 04 05 59 92 00 7d 8e 06 20 e5 de &lt;br /&gt;
 2f 11 f6 e0 7&lt;br /&gt;
&lt;br /&gt;
(not prime) f1 = &lt;br /&gt;
 20 f1 89 de ed 41 e6 df eb ea 2c 19 38 47 3b 29 &lt;br /&gt;
 25 bb 00 af 02 32 bd f5 52 31 de b9&lt;br /&gt;
&lt;br /&gt;
* Key3 = f1*f2. Please verify, thanks. yafu might be buggy&lt;br /&gt;
&lt;br /&gt;
However, &lt;br /&gt;
rsa_key3 = 3723831821883702670678201674717918174629677902801569278439133496127413091410975376899192815194880111741267989023834018905027460993096578420421399938130915013991830265235766488560948787045449571744218241649175170290402111788993338128284057787949145302879517838138041196804337537028831470042894492396009634808062527953671468669060509014833090941515&lt;br /&gt;
f1 = 17876955317115447381157919886144538387308441247085257635572171826794253277256372460463477770098763696910986285378300627539600204950194621383554975965324631149532355710525801309465604474665765254953825047369078348205584002973869012758851553079758612258254980441408089061867729556772&lt;br /&gt;
f2 = 19574178722326421301599573536448352386098089397337991030176983150880&lt;br /&gt;
f1*f2 = 349926718388261371569022220378917782692194588648747109479039236183507739374218762137974554503090374018744169165998671825504162527118702221137070525632386140758758095389408367984136132994861553048641125678600013365524850972617693473037042850155943617530837212223950368442328698913412086039290071192126386225277883345300427209227825789909214401759360&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; f1*f2 != rsa_key3 - the factorization is invalid.&lt;br /&gt;
--[[User:Dogbert|Dogbert]] 17:12, 18 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_RSA_Keys&amp;diff=16884</id>
		<title>Baseband RSA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_RSA_Keys&amp;diff=16884"/>
		<updated>2011-03-18T17:05:33Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Key 3 (not semiprime?) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;These are the keys shared between the [[S-Gold 2]] and the [[X-Gold 608]]&lt;br /&gt;
&lt;br /&gt;
==Key 1==&lt;br /&gt;
This is used to validate the NCK token and decrypt secpack certificates.&lt;br /&gt;
&lt;br /&gt;
Modulus length 0x400 bits, Exponent 0x3&lt;br /&gt;
 0B 23 AE BA E3 75 7B 9D CE 44 58 8C CF 53 CC B0&lt;br /&gt;
 73 F9 06 57 64 37 A0 6C 68 F4 91 4E 7A 82 CB 6E&lt;br /&gt;
 12 CF FD 31 39 51 4C 06 C0 E9 CE A0 27 17 D6 95&lt;br /&gt;
 FB DF 94 26 B2 1C C1 73 24 06 E3 A8 C2 0F 5D A3&lt;br /&gt;
 41 6B D8 84 CB D0 EB 2E F9 DE 2F 21 78 DA C3 4D&lt;br /&gt;
 AF B9 BA D8 4B 7C 16 E2 CF 16 7A 1B 57 33 4F 26&lt;br /&gt;
 4D 53 26 FD 8E 38 B6 23 CE 5E B4 81 80 2B C0 FB&lt;br /&gt;
 9F 33 E1 3F 65 A2 49 C9 3F 08 6C 37 61 4B B7 C7&lt;br /&gt;
&lt;br /&gt;
==Key 2==&lt;br /&gt;
This is used to sign Key 3 in the [[WildcardTicket|wildcard ticket]] that is part of the [[activation token]].&lt;br /&gt;
&lt;br /&gt;
Modulus length 0x400 bits, Exponent 0x3&lt;br /&gt;
 05 BC 9F 4E 87 0C F9 A2 D8 DA 19 D8 14 82 B2 54&lt;br /&gt;
 3F 32 4D 08 0B AE 22 01 86 43 A1 0E 18 7A D1 F2&lt;br /&gt;
 4F CB 34 C6 10 C2 72 DB E3 B5 29 79 B2 80 34 E1&lt;br /&gt;
 4F A4 27 85 C5 04 57 4A 37 88 AD 9A 6B 57 C5 E0&lt;br /&gt;
 4F E5 89 80 1E ED AC 72 78 B1 73 05 FC 5E D1 3D&lt;br /&gt;
 46 9F 66 C4 B5 B4 4B 9E 87 8C 2E 3C BD 0C 15 AA&lt;br /&gt;
 D1 D5 57 71 00 D6 10 F7 96 E2 CF AC 60 53 57 C7&lt;br /&gt;
 65 AD 1D CB BC 5F 49 FD B5 ED EA B3 21 30 66 EA&lt;br /&gt;
&lt;br /&gt;
==Key 3==&lt;br /&gt;
This is used for signing in the [[WildcardTicket|wildcard ticket]]. The serial number is 1.&lt;br /&gt;
&lt;br /&gt;
Modulus length 0x400 bits, Exponent 0x3&lt;br /&gt;
 4b 52 5a e7 09 fd 94 14 3f d9 6e c6 88 c8 ce cc &lt;br /&gt;
 6e b7 43 89 05 d9 b2 8b a5 58 3d b4 cc 19 c3 31 &lt;br /&gt;
 ff 09 e7 11 2e 26 be b4 76 62 20 82 76 ed 96 d5 &lt;br /&gt;
 22 77 10 b7 6d ef 09 64 fb 2c cc b8 d1 5b 68 5d &lt;br /&gt;
 61 15 64 a3 32 df 3d 6c 7d 8e 2c 04 e0 9f 6d 15 &lt;br /&gt;
 9e 5e 9a 68 c2 d6 67 c8 fd 65 03 c3 ab 49 b8 4b &lt;br /&gt;
 94 f5 c4 ca 53 91 4b 9d 7b be 68 2b 92 95 56 68 &lt;br /&gt;
 fa 89 8e 3a 17 38 76 77 df 0f 90 b0 a0 46 1c f3 &lt;br /&gt;
 f8 48 dc 32 1b f8 a1 ff 7e 26 56 0e ce 77 95 0f&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Purplesn0w&amp;diff=9242</id>
		<title>Purplesn0w</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Purplesn0w&amp;diff=9242"/>
		<updated>2010-09-17T20:48:08Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;purplesn0w is [[User:geohot|geohot]]'s [[unlock]] which used the [[AT+XLOG Vulnerability]]. Its implementation of the vulnerability differs from [[ultrasn0w]]'s, and requires a legitimately [[Activation|activated]] [[iPhone]]. &lt;br /&gt;
&lt;br /&gt;
==How it works==&lt;br /&gt;
purplesn0w copies the page that needs patching to an unused region of memory. It gets patched in RAM. Using the MMU, the flash page is mapped out and the patched memory page is remapped in its place. No new iPhones are really [[unlock]]ed; [[activation]] creates a [[WildcardTicket|ticket]] allowing the baseband to be used with that SIM. The lockstate of the phone really lies on Apple's servers. Being unlocked means all SIMs are authorized, and being locked means only certain carriers' SIMs are authorized (for instance, AT&amp;amp;T). Fortunately, this ticket system provides an easy way to deliver the payload and re-execute the patched code all in one. And since the ticket is already delivered on baseband resets, there's no need to write another daemon to use the battery. Instead the daemon already designed for this, [[lockdownd]], is used. A patch to CommCenter gets it to run the payload on ticket delivery. And a patch to your activation record contains the payload.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;br /&gt;
&lt;br /&gt;
==Installation notes==&lt;br /&gt;
* Be sure to have a legitimately activated iPhone.&lt;br /&gt;
* Disable 3G if you don't have it (like T-Mobile in the US).&lt;br /&gt;
* Watch for success output in Cydia (actually do this step)&lt;br /&gt;
* Wait for signal, and enjoy your unlocked iPhone (no reboot required)&lt;br /&gt;
&lt;br /&gt;
==Links==&lt;br /&gt;
* Cydia repo (http://apt.geohot.com/)&lt;br /&gt;
* [http://apt.geohot.com/purplesn0w_source.zip Source code]&lt;br /&gt;
&lt;br /&gt;
[[Category:Unlocking Methods]]&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation&amp;diff=8650</id>
		<title>Activation</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation&amp;diff=8650"/>
		<updated>2010-08-23T05:14:11Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:foto.jpg|thumb|right|iPhone with 1 signal bar and damaged [[hacktivation]] or it doesn't have an internet connection|100px]]&lt;br /&gt;
&lt;br /&gt;
Activation is the process by which a new (or newly restored) iPhone can get by the &amp;quot;Emergency Call Screen&amp;quot; to access the SpringBoard. The code in charge of this resides in [[lockdownd]], which is always running on [[iOS]] and monitors the activation status of the device. Lockdownd patches (which require a [[jailbreak]]) activate your phone and obviate the need to activate legitimately through [[iTunes]] with an official carrier.&lt;br /&gt;
&lt;br /&gt;
Activation is handled by https://albert.apple.com/WebObjects/ALActivation.woa/wa/deviceActivation&lt;br /&gt;
&lt;br /&gt;
[[iTunes]] uses AMDeviceCopyValue on ActivationInfo to generate an activation ticket with your IMEI, ICCID, and serial number among other things. The ticket gets send to Apple's activation server, and you will receive an [[activation token]], getting you past the emergency call screen and allowing use of the iPhone. All devices actually go through this process; even the [[iPod touch]] is not activated out of the box, but connecting to iTunes will activate the iPod.&lt;br /&gt;
&lt;br /&gt;
The [[iPhone]] needs a cellular data connection for the first time, after the activation in [[iTunes]]. You can make calls if an alert says &amp;quot;iPhone is activated.&amp;quot; If you don't have a cellular data connection (3G, EDGE, GPRS) you won't be able to make calls and you have only 1 bar of reception. If you only have 1 bar and no carrier at the status bar, it isn't activated correctly. Installing [[ultrasn0w]] over Wi-Fi will fix it.&lt;br /&gt;
&lt;br /&gt;
While the [[iPod touch]] can be unbricked/'activated' without an internet connection, some services such as YouTube and Push Notifications will fail to work due to not having a valid authentication token.  ([http://support.apple.com/kb/TS3305 iPad and iPod touch: Unable to use YouTube or Push notifications])&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8648</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8648"/>
		<updated>2010-08-23T05:03:08Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout Activation Token */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. If the phone number can be matched to the ICCID and IMSI and if the rest of the data is correct, the server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded cert in DER format)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature probably of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8632</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8632"/>
		<updated>2010-08-23T01:44:14Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout Activation Token */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. If the phone number can be matched to the ICCID and IMSI and if the rest of the data is correct, the server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature probably of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8631</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8631"/>
		<updated>2010-08-23T01:43:58Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout Activation Token */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. If the phone number can be matched to the ICCID and IMSI and if the rest of the data is correct, the server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
	&amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature probably of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8630</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8630"/>
		<updated>2010-08-23T01:43:24Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. If the phone number can be matched to the ICCID and IMSI and if the rest of the data is correct, the server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
	&amp;lt;key&amp;gt;FairPlaySignature&amp;lt;/key&amp;gt;&lt;br /&gt;
	&amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded signature probably of ActivationInfoXML)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8625</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8625"/>
		<updated>2010-08-22T19:49:20Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. If the phone number can be matched to the ICCID and IMSI and if the rest of the data is correct, the server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;SIMGID2&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        ...&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8624</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8624"/>
		<updated>2010-08-22T19:46:35Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout ActivationInfo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. The server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;Unactivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Wildcard_Ticket&amp;diff=8549</id>
		<title>Wildcard Ticket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Wildcard_Ticket&amp;diff=8549"/>
		<updated>2010-08-20T22:14:45Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: Redirecting to WildcardTicket&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[WildcardTicket]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=WildcardTicket&amp;diff=8548</id>
		<title>WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=WildcardTicket&amp;diff=8548"/>
		<updated>2010-08-20T22:07:34Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Ticket Layout */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The wildcard ticket is used for activating the baseband. It is stored in the file &amp;quot;/var/root/Library/Lockdown/activation_records/wildcard_record.plist&amp;quot;. When activating an iPhone, the ticket is pulled from Apple's server and stored on the device. It contains all the information about sim-/netlocks. Factory- and carrier-unlocked devices receive a wildcard ticket with policies that permit all SIM cards.&lt;br /&gt;
&lt;br /&gt;
==Ticket Layout==&lt;br /&gt;
 0x0 Version number (=2 for iPhone 3G, 3GS)&lt;br /&gt;
 0x4 Encrypted Ticket&lt;br /&gt;
&lt;br /&gt;
The ticket is decrypted with [[TEA]] in [[CBC mode]] using a key hashed from the [[NORID]], [[CHIPID]], [[wikipedia:IMEI|IMEI]] and a [[wikipedia:Salt (cryptography)|salt]]. The layout of the decrypted ticket looks like this:&lt;br /&gt;
&lt;br /&gt;
 0x000        Certificate Length (in bits)&lt;br /&gt;
 0x004        Certificate Serial (usually 1)&lt;br /&gt;
 0x008        Public Key Length (in bits)&lt;br /&gt;
 0x00c        Public Key Exponent&lt;br /&gt;
 0x010-0x090  Public Key (RSA Key 3)&lt;br /&gt;
 0x090-0x110  Additional Public Key - not in use &lt;br /&gt;
 0x110-0x190  Certificate of the first 0x110 bytes signed with rsa_key2&lt;br /&gt;
 0x190-0x19B  [[wikipedia:ICCID|ICCID]] mask (relevant bits for simlock)&lt;br /&gt;
 0x19C-0x1A3  [[wikipedia:IMEI|IMEI]]&lt;br /&gt;
 0x1A4-0x1B7  [[Baseband TEA Keys#Hardware Thumbprint Generation|Hash of several hardware IDs]] ([[wikipedia:IMEI|IMEI]], [[NORID]], [[CHIPID]])&lt;br /&gt;
 0x1B8-...    Table of &amp;quot;policies&amp;quot; (netlock)&lt;br /&gt;
&lt;br /&gt;
Attached to the decrypted ticket is a certificate (0x80 byte) signed with the [[Baseband RSA Keys|RSA key 3]] at 0x010.&lt;br /&gt;
&lt;br /&gt;
==Policy Table Layout==&lt;br /&gt;
 0x0          Total length of the policy table in bytes&lt;br /&gt;
 &amp;lt;Policy Item&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An item is 12 byte in size and has this structure:&lt;br /&gt;
 0x0-0x2      ID&lt;br /&gt;
 0x2-0x4      type?&lt;br /&gt;
 0x4-0xC      [[wikipedia:IMSI|IMSI]] mask&lt;br /&gt;
&lt;br /&gt;
Each [[wikipedia:nibble|nibble]] of a mask corresponds to a number - the wildcard is encoded as 0xE.&lt;br /&gt;
&lt;br /&gt;
===AT&amp;amp;T USA===&lt;br /&gt;
 IMSI Mask&lt;br /&gt;
 310150?????????&lt;br /&gt;
 310170?????????&lt;br /&gt;
 310410?????????&lt;br /&gt;
 311180?????????&lt;br /&gt;
 310980?????????&lt;br /&gt;
This is an iPhone 3GS from [[wikipedia:List of mobile network codes in the United States|AT&amp;amp;T]].&lt;br /&gt;
&lt;br /&gt;
===T-Mobile Germany===&lt;br /&gt;
 IMSI Mask&lt;br /&gt;
 26201??????????&lt;br /&gt;
 26201??????????&lt;br /&gt;
 26201??????????&lt;br /&gt;
This is an iPhone 3G from [[wikipedia:Mobile_network_code#G|T-Mobile Germany]].&lt;br /&gt;
&lt;br /&gt;
===Factory Unlocked Device===&lt;br /&gt;
 IMSI Mask&lt;br /&gt;
 ???????????????&lt;br /&gt;
Obligatory.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=8547</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=8547"/>
		<updated>2010-08-20T22:01:12Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: my code sucks.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep1_norid,0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep2_chipid,0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,chipid,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,norid,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getWildcardKey(u8 *wKey){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
        SHA1Context ctx;&lt;br /&gt;
        SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
        SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
        SHA1Result(&amp;amp;ctx);&lt;br /&gt;
        memcpy(wKey,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8546</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8546"/>
		<updated>2010-08-20T21:58:50Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout ActivationInfo */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[CHIPID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. The server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Token==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;WildcardActivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;[[Baseband TEA Keys#Hardware Thumbprint Generation|BasebandThumbprint]]&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=8545</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=8545"/>
		<updated>2010-08-20T21:56:58Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Wildcard Ticket Key Generation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep1_norid,0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep2_chipid,0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,chipid,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,norid,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
        u8 hwTP[20];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,hwTP,20);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=8544</id>
		<title>Baseband TEA Keys</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Baseband_TEA_Keys&amp;diff=8544"/>
		<updated>2010-08-20T21:56:03Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The baseband generates [[wikipedia:Tiny Encryption Algorithm|TEA]] keys based of the [[CHIPID]] and [[NORID]].&lt;br /&gt;
&lt;br /&gt;
==Key A Generation==&lt;br /&gt;
 //return unique phone key (key A), this key is used for security zone encryption/decryption&lt;br /&gt;
 void get_keyA(u8 *A){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep1_norid,0x10);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,dep2_chipid,0x10);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(A,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==NCK Key Generation==&lt;br /&gt;
 //ulc_mix_lock_unlock_key((u8*)A,(u8*)ctx.Message_Digest,dep1_norid,dep2_chipid,(u8*)B);&lt;br /&gt;
 void ulc_mix_lock_unlock_key(u8 *keyA, u8 *keyNCK,u8 *norid,u8 *chipid,u8 *keyB){&lt;br /&gt;
 	u8 out_iv[8];&lt;br /&gt;
 	tea_3_round_encipher(norid,keyNCK,keyA,keyB,out_iv);		//norid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 	tea_3_round_encipher(chipid,keyNCK,out_iv,keyB+8,out_iv); //chipid, keyNCK, SP+4, SP+0x14, SP+0x34&lt;br /&gt;
 }&lt;br /&gt;
 // auxilary function for nck key generation&lt;br /&gt;
 void tea_3_round_encipher(u8 *in,u8 *key,u8 *iv,u8 *out,u8 *out_iv){&lt;br /&gt;
 	u32 tmpin[2],nexttea[2];&lt;br /&gt;
 	tea_encipher((u32*)in,tmpin,(u32*)key);&lt;br /&gt;
  	nexttea[0] = tmpin[0]^((u32*)iv)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)iv)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out,(u32*)key);&lt;br /&gt;
 	nexttea[0] = tmpin[0]^((u32*)out)[0];&lt;br /&gt;
 	nexttea[1] = tmpin[1]^((u32*)out)[1];&lt;br /&gt;
 	tea_encipher(nexttea,(u32*)out_iv,(u32*)key);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==Hardware Thumbprint Generation==&lt;br /&gt;
 u8 salt[20] = {  0x03, 0x5E, 0x20, 0x03, 0xA9, 0x74, 0xFC, 0x57, &lt;br /&gt;
                  0xBB, 0x2D, 0x59, 0x28, 0xBF, 0x10, 0xAE, 0xB9, &lt;br /&gt;
                  0x00, 0x00, 0x00, 0x00&lt;br /&gt;
               } ;&lt;br /&gt;
&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,chipid,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,norid,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,imei,16); //nibble encoded&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
==[[Wildcard Ticket]] Key Generation==&lt;br /&gt;
 void getHardwareThumbPrint(u8 *hwTP){&lt;br /&gt;
        u8 hwTP[16];&lt;br /&gt;
        getHardwareThumbPrint(&amp;amp;hwTP);&lt;br /&gt;
 	SHA1Context ctx;&lt;br /&gt;
 	SHA1Reset(&amp;amp;ctx);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,hwTP,16);&lt;br /&gt;
 	SHA1Input(&amp;amp;ctx,salt,20);&lt;br /&gt;
 	SHA1Result(&amp;amp;ctx);&lt;br /&gt;
 	memcpy(hwTP,(u8*)ctx.Message_Digest,0x14);&lt;br /&gt;
 }&lt;br /&gt;
The generates the key which can be used to encrypt/decrypt the wildcard ticket - the chipID/norID are NOT required.&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8541</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8541"/>
		<updated>2010-08-20T18:11:51Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout Activation Tocken */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[ChipID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. The server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Tocken==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded DRM cert here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;WildcardActivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandThumbprint&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8540</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8540"/>
		<updated>2010-08-20T18:10:56Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: /* Layout Activation Ticket */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[ChipID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. The server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Tocken==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;WildcardActivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandThumbprint&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8539</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8539"/>
		<updated>2010-08-20T18:10:11Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets a couple things from the phone: the [[DeviceID]], the [[ChipID]], the [[wikipedia:IMEI|IMEI]], the [[Wikipedia:ICCID|ICCID]], the [[Wikipedia:IMSI|IMSI]], the phone number (!), and a few other things. This is called the &amp;quot;activation token&amp;quot; and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. The server appends the [[WildcardTicket]] to the token, signs the token with Apple's private key and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does and if the baseband is able to log in to a GSM network, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token.&lt;br /&gt;
&lt;br /&gt;
==Layout Activation Ticket==&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoComplete&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationInfoXML&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;FairPlayCertChain&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64-encoded activation info here)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the first generation iPhones, the [[NCK]] field has been added. For later generation models, the [[WildcardTicket]] field is used for activating the baseband with [[AT+XLCK]].&lt;br /&gt;
&lt;br /&gt;
==Layout ActivationInfo==&lt;br /&gt;
  &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
  &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple//DTD PLIST 1.0//EN&amp;quot; &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;dict&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRandomness&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationRequiresActivationTicket&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ActivationState&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;WildcardActivated&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandMasterKeyHash&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BasebandThumbprint&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;(TEA key)string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;BuildVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;8A306&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceCertRequest&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;data&amp;gt;&lt;br /&gt;
        (base64 encoded cert)&lt;br /&gt;
        &amp;lt;/data&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;DeviceClass&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;IntegratedCircuitCardIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileEquipmentIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;InternationalMobileSubscriberIdentity&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ModelNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;MC135&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;PhoneNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductType&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;iPhone2,1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;ProductVersion&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;4.0.1&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SIMStatus&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;kCTSIMSupportSIMStatusReady&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SerialNumber&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;SupportsPostponement&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;true/&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueChipID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;integer&amp;gt;...&amp;lt;/integer&amp;gt;&lt;br /&gt;
        &amp;lt;key&amp;gt;UniqueDeviceID&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;...&amp;lt;/string&amp;gt;&lt;br /&gt;
  &amp;lt;/dict&amp;gt;&lt;br /&gt;
  &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8530</id>
		<title>Activation Token</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Activation_Token&amp;diff=8530"/>
		<updated>2010-08-20T05:21:16Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[iTunes]] gets three things from the phone, the [[DeviceID]], the [[wikipedia:IMEI|IMEI]], and the [[Wikipedia:ICCID|ICCID]]. This is called the token and is unique to every iPhone. This token is then sent to the Apple server (alfred.apple.com) via [[Wikipedia:Transport Layer Security|SSL]]. Apple uses their private key to sign the token and transmits it back to [[iTunes]]. [[iTunes]] then calls [[AMDeviceActivate]] with this signed token. The device gets the token and checks whether or not the signature matches the token. If it does, the device is activated. A patched [[lockdownd]] circumvents these checks rather then to provide a valid token. (To create a valid token someone needed Apple's private key.)&lt;br /&gt;
&lt;br /&gt;
 {&lt;br /&gt;
  &amp;quot;UniqueDeviceID&amp;quot; = &amp;quot;aabbccdd......&amp;quot;;&lt;br /&gt;
  &amp;quot;InternationalMobileEquipmentIdentity&amp;quot; = &amp;quot;1234....&amp;quot;;&lt;br /&gt;
  &amp;quot;IntegratedCircuitCardIdentity&amp;quot; = &amp;quot;1234...&amp;quot;;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
For the first generation iPhones, the [[NCK]] field has been added. For later generation models, the [[WildcardTicket]] field is used for activating the baseband with [[AT+XLCK]].&lt;br /&gt;
&lt;br /&gt;
==Resources==&lt;br /&gt;
* [[User:posixninja|posixninja]]'s [http://github.com/posixninja/ideviceactivate iDeviceActivate]&lt;br /&gt;
&lt;br /&gt;
[[Category:Baseband]]&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=8501</id>
		<title>Talk:WildcardTicket</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Talk:WildcardTicket&amp;diff=8501"/>
		<updated>2010-08-19T18:36:22Z</updated>

		<summary type="html">&lt;p&gt;Dogbert: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Theoretically, can't we just edit the .plist? and make it into the factory unlocked IMSI Mask? -- {{unsigned|Leobruh|5:32, 19 August 2010 (UTC)}}&lt;br /&gt;
:The activation plist is signed, so to do this you require a jailbreak anyway. - lilstevie&lt;br /&gt;
&lt;br /&gt;
i realize that. but wouldnt this result in a permanent unlock? [[User:Leobruh|Leobruh]] 07:37, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
I'm guessing the ticket is handled by the baseband, which requires an exploit to get unsigned code running in the first place? [[User:Iemit737|Iemit737]] 07:41, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
The wildcard ticket is also signed - simple edits break the signature and the ticket gets rejected then. rtfm cryptography 101. [[User:dogbert|dogbert]] 16:02, 19 August 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
kay but unsigned code already runs when the phone is jailbroken and has access to the filesystem. wouldnt editing the .plist be okay since the sig checks arent needed. again this is all theoretical. im jw [[User:Leobruh|Leobruh]] 18:33, 19 August 2010 (UTC)!&lt;br /&gt;
&lt;br /&gt;
The baseband processor checks the signature, not the application processor. [[User:dogbert|dogbert]] 18:36, 19 August 2010 (UTC)&lt;/div&gt;</summary>
		<author><name>Dogbert</name></author>
		
	</entry>
</feed>