<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://xboxdevwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Master-bob</id>
		<title>xboxdevwiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://xboxdevwiki.net/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Master-bob"/>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/Special:Contributions/Master-bob"/>
		<updated>2026-05-04T00:23:06Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.28.0</generator>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6675</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6675"/>
				<updated>2019-01-23T16:23:33Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* REQ-BODY */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    // decrypt the EEPROM to get the correct hdd key&lt;br /&gt;
    rc4_key = SHA1-HMAC of the hdd_key using &amp;quot;60 59 E8 2E DF BF 7F D3 23 35 74 2A 64 8B B1 2C&amp;quot;&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response. Not sure if it's actually needed for AS-REP.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT &lt;br /&gt;
** SPPA1 - SHA1 of PPA1&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of ths serial number appended to the serial number using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** Xbox Live Dashboard 5849 - XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos request. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* nonce - a randomly generated number&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG uniqueID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    salted_nonce = &amp;quot;5F F3 28 92 13 8C 9C 4B 05 84 9A 3C 10 1A DB 5D&amp;quot; // MD5 of &amp;quot;02 04 00 00 00 00 00 00&amp;quot;&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of salted_nonce using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
The machine account is encrypted with the nonce HMAC key and salt 1203 using RC4-HMAC-MD5. The encrypted bytes are packed as a Kerberos EncryptedData object into a PA-DATA TYPE 203 preauthentication header in the AS-REP.&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6674</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6674"/>
				<updated>2019-01-23T16:20:37Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    // decrypt the EEPROM to get the correct hdd key&lt;br /&gt;
    rc4_key = SHA1-HMAC of the hdd_key using &amp;quot;60 59 E8 2E DF BF 7F D3 23 35 74 2A 64 8B B1 2C&amp;quot;&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response. Not sure if it's actually needed for AS-REP.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT &lt;br /&gt;
** SPPA1 - SHA1 of PPA1&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of ths serial number appended to the serial number using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** Xbox Live Dashboard 5849 - XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* nonce - a randomly generated number&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG uniqueID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    salted_nonce = &amp;quot;5F F3 28 92 13 8C 9C 4B 05 84 9A 3C 10 1A DB 5D&amp;quot; // MD5 of &amp;quot;02 04 00 00 00 00 00 00&amp;quot;&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of salted_nonce using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
The machine account is encrypted with the nonce HMAC key and salt 1203 using RC4-HMAC-MD5. The encrypted bytes are packed as a Kerberos EncryptedData object into a PA-DATA TYPE 203 preauthentication header in the AS-REP.&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6673</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6673"/>
				<updated>2019-01-23T04:18:58Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* Nonce HMAC Key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    // decrypt the EEPROM to get the correct hdd key&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856 - Xbox Live Dashboard 5849&lt;br /&gt;
&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    salted_nonce = MD5 of &amp;quot;02 04 00 00 00 00 00 00&amp;quot;&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of salted_nonce using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
The machine account is encrypted with the nonce HMAC key and salt 1203 using RC4-HMAC-MD5. The encrypted bytes are packed as a Kerberos EncrpytedData object into a PA-DATA TYPE 203 preauthentication header in the AS-REP.&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6670</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6670"/>
				<updated>2019-01-22T04:39:18Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-XBOX-CLIENT-VERSION */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    // decrypt the EEPROM to get the correct hdd key&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856 - Xbox Live Dashboard 5849&lt;br /&gt;
&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
The machine account is encrypted with the nonce HMAC key and salt 1203 using RC4-HMAC-MD5. The encrypted bytes are packed as a Kerberos EncrpytedData object into a PA-DATA TYPE 203 preauthentication header in the AS-REP.&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6669</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6669"/>
				<updated>2019-01-22T04:38:40Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-ENC-TIMESTAMP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    // decrypt the EEPROM to get the correct hdd key&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
The machine account is encrypted with the nonce HMAC key and salt 1203 using RC4-HMAC-MD5. The encrypted bytes are packed as a Kerberos EncrpytedData object into a PA-DATA TYPE 203 preauthentication header in the AS-REP.&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6668</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6668"/>
				<updated>2019-01-22T04:35:46Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* Building the Response */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
===Encryption===&lt;br /&gt;
The machine account is encrypted with the nonce HMAC key and salt 1203 using RC4-HMAC-MD5. The encrypted bytes are packed as a Kerberos EncrpytedData object into a PA-DATA TYPE 203 preauthentication header in the AS-REP.&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6667</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6667"/>
				<updated>2019-01-22T04:24:15Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-PAC-REQUEST-EX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to a custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6666</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6666"/>
				<updated>2019-01-22T04:22:36Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-PAC-REQUEST-EX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, and are used to tell the server to include a PUID PAC (20) in the response&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6665</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6665"/>
				<updated>2019-01-22T04:12:58Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* The Machine Account */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX (the console serial number)&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6664</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6664"/>
				<updated>2019-01-22T04:11:36Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* The Machine Account */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
The following is how the machine account is built ''for transfer''. It is stored in a different fashion.&lt;br /&gt;
&lt;br /&gt;
    ULONGLONG userID;&lt;br /&gt;
    CHAR gamertag[16];  // SN.XXXXXXXXXXXX&lt;br /&gt;
    CHAR domain[20];    // xbox.com&lt;br /&gt;
    CHAR realm[24];     // passport.net&lt;br /&gt;
    BYTE key[16];&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6663</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6663"/>
				<updated>2019-01-22T03:56:18Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using a magical key&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6662</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6662"/>
				<updated>2019-01-22T03:26:56Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-XBOX-PRE-PRE-AUTH */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using &amp;quot;60 59 E8 2E DF BF 7F D3 23 35 74 2A 64 8B B1 2C&amp;quot;&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6661</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6661"/>
				<updated>2019-01-22T03:23:54Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-ENC-TIMESTAMP */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The key is decrypted using:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using &amp;quot;60 59 E8 2E DF BF 7F D3 23 35 74 2A 64 8B B1 2C&amp;quot;&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6660</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6660"/>
				<updated>2019-01-22T03:23:15Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* Online Key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    rc4_key = HMAC-SHA1 of the hdd_key using &amp;quot;60 59 E8 2E DF BF 7F D3 23 35 74 2A 64 8B B1 2C&amp;quot;&lt;br /&gt;
    decrypted_online_key = rc4 of online_key using rc4_key&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6659</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6659"/>
				<updated>2019-01-22T03:15:36Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* Nonce HMAC Key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1026) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6658</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6658"/>
				<updated>2019-01-22T03:05:48Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* Nonce HMAC Key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1203) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    // if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6657</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6657"/>
				<updated>2019-01-22T03:05:22Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* Nonce HMAC Key */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
The nonce HMAC key, used to encrypt the machine account, is computed as follows:&lt;br /&gt;
&lt;br /&gt;
    temp_key = MD5-HMAC of the null terminated string &amp;quot;signaturekey&amp;quot; using the online key&lt;br /&gt;
    md5_ctx = MD5 of the salt (1203) as a ULONG and the nonce as a DWORD&lt;br /&gt;
    nonce_hmac_key = MD5-HMAC of md5_ctx using temp_key&lt;br /&gt;
&lt;br /&gt;
The key can be verified using the signature from the PA-XBOX-CLIENT-VERSION preauth:&lt;br /&gt;
&lt;br /&gt;
    test_signature = SHA1-HMAC of the version_string using the nonce_hmac_key&lt;br /&gt;
    if both signatures match, the key was generated correctly&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6656</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6656"/>
				<updated>2019-01-22T02:46:59Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;br /&gt;
&lt;br /&gt;
==Building the Response==&lt;br /&gt;
The server must generate a valid machine account and encrypt it using the correct key.&lt;br /&gt;
&lt;br /&gt;
===The Machine Account===&lt;br /&gt;
&lt;br /&gt;
===Nonce HMAC Key===&lt;br /&gt;
&lt;br /&gt;
==AS-REP==&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6655</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6655"/>
				<updated>2019-01-22T02:40:38Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-PAC-REQUEST-EX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
13 and 14 presumably correlate to PAC_CLIENT_IDENTITY and PAC_COMPOUND_IDENTITY, respectively, but I'm not sure about that.&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6654</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6654"/>
				<updated>2019-01-22T02:36:59Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: /* PA-PAC-REQUEST-EX */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REQs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6653</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6653"/>
				<updated>2019-01-22T02:36:04Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''.&lt;br /&gt;
&lt;br /&gt;
The Xbox would only connect to MACS once, the first time the console ever connected to Xbox Live. MACS was presumably used to keep banned consoles off of Xbox Live, and is still used to this day for Xbox 360s. &lt;br /&gt;
&lt;br /&gt;
The MACS exchange, like the majority of Xbox Live authentication, is done using the Kerberos system.&lt;br /&gt;
&lt;br /&gt;
==AS-REQ==&lt;br /&gt;
The first step of MACS authentication is sending an AS-REQ to MACS.XBOXLIVE.COM on UDP port 88. The AS-REQ is composed of several components.&lt;br /&gt;
&lt;br /&gt;
*PVNO and MSG TYPE - These have default values of 5 (Kerberos version 5) and 10 (krb-as-req), respectively. &lt;br /&gt;
&lt;br /&gt;
===PADATA===&lt;br /&gt;
Pre authentication data (PADATA) contains most of what makes this request unique from other Kerberos systems.&lt;br /&gt;
&lt;br /&gt;
====PA-ENC-TIMESTAMP====&lt;br /&gt;
PA-DATA TYPE 2&lt;br /&gt;
&lt;br /&gt;
An official part of the Kerberos standard, this is a Unix timestamp encrypted with the later defined encryption standard (in Xbox's case, RC4-HMAC-MD5). The server attempts to decrypt this to confirm that the client is using the correct password. For MACS, the password is the console's '''Online Key''', which Microsoft stored server side on a very well guarded database.&lt;br /&gt;
&lt;br /&gt;
=====Online Key=====&lt;br /&gt;
The online key is stored in an encrypted form on the Xbox's [[EEPROM]]. The following algorithm is used to decrypt it:&lt;br /&gt;
&lt;br /&gt;
    // TODO: Add code&lt;br /&gt;
&lt;br /&gt;
====PA-PAC-REQUEST-EX====&lt;br /&gt;
PA-DATA TYPE 131&lt;br /&gt;
&lt;br /&gt;
This is an Xbox modification to custom Microsoft (PA-PAC-REQUEST) addition to Kerberos, used to define what the client expects in the response. This is encoded in ASN.1 (method of packing data structures into bytes, used by Kerberos). All AS-REPs contain the following data in this section:&lt;br /&gt;
&lt;br /&gt;
    SEQUENCE (2 elem)&lt;br /&gt;
        [0] (1 elem)&lt;br /&gt;
            BOOLEAN true&lt;br /&gt;
        [1] (1 elem)&lt;br /&gt;
            SEQUENCE (2 elem)&lt;br /&gt;
                INTEGER 13&lt;br /&gt;
                INTEGER 14&lt;br /&gt;
&lt;br /&gt;
====PA-XBOX-PRE-PRE-AUTH====&lt;br /&gt;
PA-DATA TYPE 204&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header that was used by Microsoft to quickly look up Xbox information from their database and is probably not needed for. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* currentTime - the current time, sent as a FILETIME&lt;br /&gt;
* PPA1 - SHA1-HMAC of the principal name (the Xbox serial number) using the principal key (the online key)&lt;br /&gt;
* SPPA2atT - computed as follows&lt;br /&gt;
** SPPA1 - SHA1(PPA1)&lt;br /&gt;
** PPA2 - First 8 bytes of SHA1-HMAC of PrincipalName appended to PrincipalName using the principal key&lt;br /&gt;
** SPPA2atT - SHA1 of PPA2 appended to the current time&lt;br /&gt;
====PA-XBOX-CLIENT-VERSION====&lt;br /&gt;
PA-DATA TYPE 206&lt;br /&gt;
&lt;br /&gt;
This is a custom preauthentication header and arguably the most important for MACS authentication from a homebrew perspective. Contains the following:&lt;br /&gt;
&lt;br /&gt;
* signature - a 20 byte array used to verify the encryption key generated for the response&lt;br /&gt;
* version - null terminated string with information about the application sending the request&lt;br /&gt;
** XboxVersion=1.00.5849.3 Title=0xFFFE0000 TitleVersion=408857856&lt;br /&gt;
===REQ-BODY===&lt;br /&gt;
The remainder of the Kerberos ticket. '''Bold''' indicates the data are used for response building.&lt;br /&gt;
&lt;br /&gt;
* Padding - 0&lt;br /&gt;
* KDC-Options - 0b00010000 (canonicalize)&lt;br /&gt;
* '''cname - the serial number of the Xbox'''&lt;br /&gt;
* realm - MACS.XBOX.COM&lt;br /&gt;
* sname - krbtgt@MACS.XBOX.COM&lt;br /&gt;
* till - 2037-09-13 02:48:05 (UTC)&lt;br /&gt;
* '''nonce - a randomly generated number'''&lt;br /&gt;
* '''etype - RC4-HMAC-MD5'''&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob&amp;diff=6652</id>
		<title>User:Master-bob</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob&amp;diff=6652"/>
				<updated>2019-01-22T01:48:20Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: Created page with &amp;quot;The following are links to my research on Xbox Live  * Machine Account Creation Service (MACS)&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The following are links to my research on Xbox Live&lt;br /&gt;
&lt;br /&gt;
* [[User:Master-bob/MACS|Machine Account Creation Service (MACS)]]&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	<entry>
		<id>https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6651</id>
		<title>User:Master-bob/MACS</title>
		<link rel="alternate" type="text/html" href="https://xboxdevwiki.net/index.php?title=User:Master-bob/MACS&amp;diff=6651"/>
				<updated>2019-01-22T01:48:14Z</updated>
		
		<summary type="html">&lt;p&gt;Master-bob: Created page with &amp;quot;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The first step of Xbox Live authentication is connecting to the '''Machine Account Creation Service''', located at '''MACS.XBOXLIVE.COM'''&lt;/div&gt;</summary>
		<author><name>Master-bob</name></author>	</entry>

	</feed>